[rhythmbox] podcast: stop setting status property on podcast feeds
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] podcast: stop setting status property on podcast feeds
- Date: Sun, 6 Mar 2022 12:00:28 +0000 (UTC)
commit 446407e98e1f74dcbc94c1d644d489266565656c
Author: Jonathan Matthew <jonathan d14n org>
Date: Sun Feb 20 11:53:20 2022 +1000
podcast: stop setting status property on podcast feeds
This was only really used to indicate whether the feed was currently
being updated, which is a transient property that doesn't belong in
the database. rb_podcast_manager_unsubscribe_feed() also allowed a
feed entry to be hidden, but that was unused.
podcast/rb-podcast-manager.c | 43 -------------------------------------------
podcast/rb-podcast-manager.h | 1 -
podcast/rb-podcast-source.c | 5 +----
rhythmdb/rhythmdb-private.h | 6 +-----
rhythmdb/rhythmdb.h | 4 ----
5 files changed, 2 insertions(+), 57 deletions(-)
---
diff --git a/podcast/rb-podcast-manager.c b/podcast/rb-podcast-manager.c
index be3398704..e1976912e 100644
--- a/podcast/rb-podcast-manager.c
+++ b/podcast/rb-podcast-manager.c
@@ -739,11 +739,6 @@ feed_parse_cb (RBPodcastChannel *channel, GError *error, gpointer user_data)
rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_PLAYBACK_ERROR, &v);
g_value_unset (&v);
- g_value_init (&v, G_TYPE_ULONG);
- g_value_set_ulong (&v, RHYTHMDB_PODCAST_FEED_STATUS_NORMAL);
- rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_STATUS, &v);
- g_value_unset (&v);
-
rhythmdb_commit (pd->priv->db);
}
@@ -856,7 +851,6 @@ rb_podcast_manager_subscribe_feed (RBPodcastManager *pd, const char *url, gboole
entry = rhythmdb_entry_lookup_by_location (pd->priv->db, feed_url);
if (entry) {
- GValue v = {0,};
if (rhythmdb_entry_get_entry_type (entry) != RHYTHMDB_ENTRY_TYPE_PODCAST_FEED) {
/* added as something else, probably iradio */
rb_error_dialog (NULL, _("URL already added"),
@@ -870,12 +864,6 @@ rb_podcast_manager_subscribe_feed (RBPodcastManager *pd, const char *url, gboole
return FALSE;
}
- g_value_init (&v, G_TYPE_ULONG);
- g_value_set_ulong (&v, RHYTHMDB_PODCAST_FEED_STATUS_UPDATING);
- rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_STATUS, &v);
- rhythmdb_commit (pd->priv->db);
- g_value_unset (&v);
-
start_feed_parse (pd, update);
} else if (rb_uri_could_be_podcast (feed_url, NULL)) {
rb_debug ("not checking mime type for %s", feed_url);
@@ -1160,19 +1148,6 @@ rb_podcast_manager_db_entry_added_cb (RBPodcastManager *pd, RhythmDBEntry *entry
-void
-rb_podcast_manager_unsubscribe_feed (RhythmDB *db, const char *url)
-{
- RhythmDBEntry *entry = rhythmdb_entry_lookup_by_location (db, url);
- if (entry) {
- GValue val = {0, };
- g_value_init (&val, G_TYPE_ULONG);
- g_value_set_ulong (&val, RHYTHMDB_PODCAST_FEED_STATUS_HIDDEN);
- rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_STATUS, &val);
- g_value_unset (&val);
- }
-}
-
gboolean
rb_podcast_manager_remove_feed (RBPodcastManager *pd, const char *url, gboolean remove_files)
{
@@ -1309,10 +1284,6 @@ rb_podcast_manager_insert_feed_url (RBPodcastManager *pd, const char *url)
entry = rhythmdb_entry_lookup_by_location (pd->priv->db, url);
if (entry) {
rb_debug ("podcast feed entry for %s found", url);
- g_value_init (&val, G_TYPE_ULONG);
- g_value_set_ulong (&val, RHYTHMDB_PODCAST_FEED_STATUS_NORMAL);
- rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_STATUS, &val);
- g_value_unset (&val);
return;
}
rb_debug ("adding podcast feed %s with no entries", url);
@@ -1322,11 +1293,6 @@ rb_podcast_manager_insert_feed_url (RBPodcastManager *pd, const char *url)
if (entry == NULL)
return;
- g_value_init (&val, G_TYPE_ULONG);
- g_value_set_ulong (&val, RHYTHMDB_PODCAST_FEED_STATUS_NORMAL);
- rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_STATUS, &val);
- g_value_unset (&val);
-
g_value_init (&val, G_TYPE_STRING);
g_value_set_string (&val, url);
rhythmdb_entry_set (pd->priv->db, entry, RHYTHMDB_PROP_TITLE, &val);
@@ -1401,10 +1367,6 @@ rb_podcast_manager_add_parsed_feed (RBPodcastManager *pd, RBPodcastChannel *data
}
rb_debug ("Podcast feed entry for %s found", data->url);
- g_value_init (&val, G_TYPE_ULONG);
- g_value_set_ulong (&val, RHYTHMDB_PODCAST_FEED_STATUS_NORMAL);
- rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_STATUS, &val);
- g_value_unset (&val);
last_post = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_POST_TIME);
new_feed = FALSE;
@@ -1432,11 +1394,6 @@ rb_podcast_manager_add_parsed_feed (RBPodcastManager *pd, RBPodcastChannel *data
return;
}
- g_value_init (&val, G_TYPE_ULONG);
- g_value_set_ulong (&val, RHYTHMDB_PODCAST_FEED_STATUS_NORMAL);
- rhythmdb_entry_set (db, entry, RHYTHMDB_PROP_STATUS, &val);
- g_value_unset (&val);
-
status = RB_PODCAST_FEED_UPDATE_SUBSCRIBED;
}
diff --git a/podcast/rb-podcast-manager.h b/podcast/rb-podcast-manager.h
index 83758e7b7..ecbd0bcc7 100644
--- a/podcast/rb-podcast-manager.h
+++ b/podcast/rb-podcast-manager.h
@@ -86,7 +86,6 @@ gchar * rb_podcast_manager_get_podcast_dir (RBPodcastManager *pd
gboolean rb_podcast_manager_subscribe_feed (RBPodcastManager *pd, const gchar* url,
gboolean automatic);
void rb_podcast_manager_add_parsed_feed (RBPodcastManager *pd, RBPodcastChannel
*feed);
void rb_podcast_manager_insert_feed_url (RBPodcastManager *pd, const char *url);
-void rb_podcast_manager_unsubscribe_feed (RhythmDB *db, const gchar* url);
gboolean rb_podcast_manager_feed_updating (RBPodcastManager *pd, const char *url);
void rb_podcast_manager_shutdown (RBPodcastManager *pd);
diff --git a/podcast/rb-podcast-source.c b/podcast/rb-podcast-source.c
index 8fc97b728..1259b882a 100644
--- a/podcast/rb-podcast-source.c
+++ b/podcast/rb-podcast-source.c
@@ -284,9 +284,6 @@ rb_podcast_source_do_query (RBPodcastSource *source, gboolean feed_query)
RHYTHMDB_QUERY_PROP_EQUALS,
RHYTHMDB_PROP_TYPE,
RHYTHMDB_ENTRY_TYPE_PODCAST_FEED,
- RHYTHMDB_QUERY_PROP_NOT_EQUAL,
- RHYTHMDB_PROP_STATUS,
- RHYTHMDB_PODCAST_FEED_STATUS_HIDDEN,
RHYTHMDB_QUERY_END);
g_object_unref (feed_query_model);
} else {
@@ -908,7 +905,7 @@ podcast_entry_changed_cb (RhythmDB *db,
switch (change->prop) {
case RHYTHMDB_PROP_PLAYBACK_ERROR:
- case RHYTHMDB_PROP_STATUS:
+ case RHYTHMDB_PROP_TITLE:
feed_changed = TRUE;
break;
default:
diff --git a/rhythmdb/rhythmdb-private.h b/rhythmdb/rhythmdb-private.h
index 5eb2a8059..a071e4b2c 100644
--- a/rhythmdb/rhythmdb-private.h
+++ b/rhythmdb/rhythmdb-private.h
@@ -45,11 +45,7 @@ typedef struct {
RBRefString *copyright;
RBRefString *image;
RBRefString *guid;
- gulong status; /* 0-99: downloading
- 100: Complete
- 101: Error
- 102: wait
- 103: pause */
+ gulong status;
gulong post_time;
} RhythmDBPodcastFields;
diff --git a/rhythmdb/rhythmdb.h b/rhythmdb/rhythmdb.h
index 9ee1fa849..e6e90be07 100644
--- a/rhythmdb/rhythmdb.h
+++ b/rhythmdb/rhythmdb.h
@@ -181,10 +181,6 @@ typedef enum
} RhythmDBPropType;
enum {
- RHYTHMDB_PODCAST_FEED_STATUS_HIDDEN = 0,
- RHYTHMDB_PODCAST_FEED_STATUS_NORMAL = 1,
- RHYTHMDB_PODCAST_FEED_STATUS_UPDATING = 2,
-
RHYTHMDB_PODCAST_STATUS_COMPLETE = 100,
RHYTHMDB_PODCAST_STATUS_ERROR = 101,
RHYTHMDB_PODCAST_STATUS_WAITING = 102,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]