[totem-pl-parser/wip/hadess/dont-recurse-videosite: 1/2] podcast: Do not check for videosite links unless requested
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser/wip/hadess/dont-recurse-videosite: 1/2] podcast: Do not check for videosite links unless requested
- Date: Fri, 25 Jun 2021 08:24:41 +0000 (UTC)
commit 52de144ae730024fda9c79ca1252c6af92f325d6
Author: Bastien Nocera <hadess hadess net>
Date: Thu Mar 4 16:45:29 2021 +0100
podcast: Do not check for videosite links unless requested
We don't need to check whether links in RSS feeds are videosite links
unless the application requested that we do, by enabling recursive
parsing.
Closes: #25
plparse/totem-pl-parser-podcast.c | 10 ++++++++--
plparse/totem-pl-parser.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plparse/totem-pl-parser-podcast.c b/plparse/totem-pl-parser-podcast.c
index 87917d8..16a31d6 100644
--- a/plparse/totem-pl-parser-podcast.c
+++ b/plparse/totem-pl-parser-podcast.c
@@ -273,6 +273,7 @@ parse_rss_item (TotemPlParser *parser, xml_node_t *parent)
if (tmp != NULL)
content_type = tmp;
} else if (g_ascii_strcasecmp (node->name, "link") == 0 &&
+ totem_pl_parser_get_recurse (parser) &&
totem_pl_parser_is_videosite (node->data, totem_pl_parser_is_debugging_enabled
(parser)) != FALSE) {
uri = node->data;
} else if (g_ascii_strcasecmp (node->name, "image") == 0) {
@@ -294,6 +295,7 @@ parse_rss_item (TotemPlParser *parser, xml_node_t *parent)
if (id != NULL &&
uri == NULL &&
+ totem_pl_parser_get_recurse (parser) &&
totem_pl_parser_is_videosite (id, totem_pl_parser_is_debugging_enabled (parser)) != FALSE)
uri = id;
@@ -580,8 +582,10 @@ parse_atom_entry (TotemPlParser *parser, xml_node_t *parent)
href = xml_parser_get_property (node, "href");
if (href == NULL)
continue;
- if (!totem_pl_parser_is_videosite (href, totem_pl_parser_is_debugging_enabled
(parser)))
+ if (totem_pl_parser_get_recurse (parser) &&
+ !totem_pl_parser_is_videosite (href, totem_pl_parser_is_debugging_enabled
(parser))) {
continue;
+ }
uri = href;
}
} else if (g_ascii_strcasecmp (node->name, "updated") == 0
@@ -614,8 +618,10 @@ parse_atom_entry (TotemPlParser *parser, xml_node_t *parent)
prop = xml_parser_get_property (child, "url");
if (prop == NULL)
continue;
- if (!totem_pl_parser_is_videosite (prop,
totem_pl_parser_is_debugging_enabled (parser)))
+ if (totem_pl_parser_get_recurse (parser) &&
+ !totem_pl_parser_is_videosite (prop,
totem_pl_parser_is_debugging_enabled (parser))) {
continue;
+ }
uri = prop;
} else if (g_ascii_strcasecmp (child->name, "media:thumbnail") == 0) {
img = xml_parser_get_property (child, "url");
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index 8706eeb..404deb3 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -2059,7 +2059,7 @@ totem_pl_parser_parse_internal (TotemPlParser *parser,
/* Should we try to parse it with quvi? */
if (g_file_has_uri_scheme (file, "http") ||
g_file_has_uri_scheme (file, "https")) {
- if (uri != NULL && totem_pl_parser_is_videosite (uri, parser->priv->debug) != FALSE) {
+ if (uri != NULL && parse_data->recurse && totem_pl_parser_is_videosite (uri,
parser->priv->debug) != FALSE) {
ret = totem_pl_parser_add_videosite (parser, file, base_file, parse_data, NULL);
if (ret == TOTEM_PL_PARSER_RESULT_SUCCESS)
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]