summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2019-11-09 14:10:24 +0100
committerBastien Nocera <hadess@hadess.net>2019-11-09 14:16:54 +0100
commit49854e9aa25586ab275ecbc1a05eec039ab47deb (patch)
tree77349666ef63abe5c430fbc0aa4fad2fb60450d2
parent29cbef5dd74f598219d89a88520bc38013532530 (diff)
downloadtotem-pl-parser-49854e9aa25586ab275ecbc1a05eec039ab47deb.tar.gz
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.
-rw-r--r--plparse/tests/foo/some-information-file.txt1
-rw-r--r--plparse/tests/some-information-file.txt1
-rw-r--r--plparse/totem-pl-parser.c5
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) {