[rhythmbox] podcast: add support for feed parse status in podcast channel
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] podcast: add support for feed parse status in podcast channel
- Date: Tue, 1 Jun 2021 11:59:13 +0000 (UTC)
commit c689617dd12331658135adcf146dca83be4a1978
Author: crvi <crvisqr gmail com>
Date: Mon Mar 8 00:25:58 2021 +0530
podcast: add support for feed parse status in podcast channel
podcast/rb-podcast-parse.c | 3 +++
podcast/rb-podcast-parse.h | 8 ++++++++
2 files changed, 11 insertions(+)
---
diff --git a/podcast/rb-podcast-parse.c b/podcast/rb-podcast-parse.c
index 1f4b4b490..e5bbe9132 100644
--- a/podcast/rb-podcast-parse.c
+++ b/podcast/rb-podcast-parse.c
@@ -171,6 +171,7 @@ parse_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
totem_pl_parser_parse_finish (TOTEM_PL_PARSER (source_object), res, &error);
if (error) {
+ channel->status = RB_PODCAST_PARSE_STATUS_ERROR;
rb_debug ("parsing %s as a podcast failed: %s", channel->url, error->message);
g_clear_error (&error);
@@ -179,6 +180,7 @@ parse_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
RB_PODCAST_PARSE_ERROR_XML_PARSE,
_("Unable to parse the feed contents"));
} else if (channel->posts == NULL) {
+ channel->status = RB_PODCAST_PARSE_STATUS_ERROR;
/*
* treat empty feeds, or feeds that don't contain any downloadable items, as
* an error.
@@ -189,6 +191,7 @@ parse_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
RB_PODCAST_PARSE_ERROR_NO_ITEMS,
_("The feed does not contain any downloadable items"));
} else {
+ channel->status = RB_PODCAST_PARSE_STATUS_SUCCESS;
rb_debug ("parsing %s as a podcast succeeded", channel->url);
}
diff --git a/podcast/rb-podcast-parse.h b/podcast/rb-podcast-parse.h
index 31b564d4c..b05d949fb 100644
--- a/podcast/rb-podcast-parse.h
+++ b/podcast/rb-podcast-parse.h
@@ -39,6 +39,13 @@ typedef enum
RB_PODCAST_PARSE_ERROR_NO_ITEMS, /* feed doesn't contain any downloadable items */
} RBPodcastParseError;
+typedef enum
+{
+ RB_PODCAST_PARSE_STATUS_UNPARSED, /* feed unparsed */
+ RB_PODCAST_PARSE_STATUS_SUCCESS, /* feed parse succeeded */
+ RB_PODCAST_PARSE_STATUS_ERROR, /* feed parse failed */
+} RBPodcastParseStatus;
+
#define RB_PODCAST_PARSE_ERROR rb_podcast_parse_error_quark ()
GQuark rb_podcast_parse_error_quark (void);
@@ -71,6 +78,7 @@ typedef struct
GList *posts;
int num_posts;
+ RBPodcastParseStatus status;
} RBPodcastChannel;
GType rb_podcast_channel_get_type (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]