File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 44 */
55
66namespace Music.M3U {
7- public bool is_playlist (File suspicious_file ) {
8- bool if_playlist = false ;
7+ public bool is_playlist (File file ) {
98 try {
10- var info = suspicious_file. query_info (GLib . FileAttribute . STANDARD_CONTENT_TYPE , FileQueryInfoFlags . NONE );
11- var mimetype = info. get_content_type () ?? " " ;
12- if_playlist = mimetype == " audio/x-mpegurl" ;
13-
9+ var info = file. query_info (GLib . FileAttribute . STANDARD_CONTENT_TYPE , FileQueryInfoFlags . NONE );
1410 } catch (Error e) {
1511 warning (e. message);
12+ return false ;
13+ }
14+
15+ var mimetype = info. get_content_type ();
16+ if (mimetype == null ) {
17+ warning (" Failed to get content type" );
18+ return false ;
1619 }
1720
18- return if_playlist ;
21+ return mimetype == " audio/x-mpegurl " ;
1922 }
2023
2124 // Standard specification here: https://en.wikipedia.org/wiki/M3U
You can’t perform that action at this time.
0 commit comments