[totem-pl-parser/wip/hadess/add-ignored-extensions: 6/8] plparser: Apply same check to remote text files as local ones



commit 0fdc74d54807bcbcd2f6436a2098e9b3676e0cd9
Author: Bastien Nocera <hadess hadess net>
Date:   Sat Nov 9 14:10:24 2019 +0100

    plparser: Apply same check to remote text files as local ones
    
    This was causing text files on remote locations not to be ignored when
    parsing, so one would usually end up with a bunch of text files in their
    playlists when they wouldn't be wanted.

 plparse/tests/foo/some-information-file.txt | 1 +
 plparse/tests/some-information-file.txt     | 1 +
 plparse/totem-pl-parser.c                   | 5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/plparse/tests/foo/some-information-file.txt b/plparse/tests/foo/some-information-file.txt
new file mode 100644
index 0000000..d354b88
--- /dev/null
+++ b/plparse/tests/foo/some-information-file.txt
@@ -0,0 +1 @@
+This is an empty file that isn't really a playlist
diff --git a/plparse/tests/some-information-file.txt b/plparse/tests/some-information-file.txt
new file mode 100644
index 0000000..d354b88
--- /dev/null
+++ b/plparse/tests/some-information-file.txt
@@ -0,0 +1 @@
+This is an empty file that isn't really a playlist
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 8fb0eab..0d34ceb 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -1857,8 +1857,9 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
        }
 
        DEBUG(file, g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", uri, mimetype));
-       if (mimetype == NULL || strcmp (UNKNOWN_TYPE, mimetype) == 0
-           || (g_file_is_native (file) && g_content_type_is_a (mimetype, "text/plain") != FALSE)) {
+       if (mimetype == NULL ||
+           strcmp (UNKNOWN_TYPE, mimetype) == 0 ||
+           g_content_type_is_a (mimetype, "text/plain") != FALSE) {
                char *new_mimetype;
                new_mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
                if (new_mimetype) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]