Re: [Rhythmbox-devel] ipod shuffle
- From: Jonty Pearson <jontyp gmail com>
- To: rhythmbox-devel gnome org
- Subject: Re: [Rhythmbox-devel] ipod shuffle
- Date: Thu, 22 Mar 2007 11:49:15 -0700
Hi James,
Second attempt attached. Not sure if this any more suitable than the
previous patch...
Jonty.
--- plugins/ipod/rb-ipod-source-orig.c 2007-03-21 17:50:25.000000000 -0700
+++ plugins/ipod/rb-ipod-source.c 2007-03-22 11:22:44.000000000 -0700
@@ -86,7 +86,7 @@
static gchar* ipod_path_from_unix_path (const gchar *mount_point,
const gchar *unix_path);
#endif
-static void itdb_schedule_save (Itdb_iTunesDB *db);
+static void itdb_schedule_save (Itdb_iTunesDB *db, gboolean write_itunessd);
typedef struct
{
@@ -95,7 +95,7 @@
GHashTable *entry_map;
GList *playlists;
-
+ gboolean requires_itunessd;
guint load_idle_id;
} RBiPodSourcePrivate;
@@ -152,7 +152,7 @@
}
g_free (mpl->name);
mpl->name = g_strdup (name);
- itdb_schedule_save (priv->ipod_db);
+ itdb_schedule_save (priv->ipod_db, priv->requires_itunessd);
} else {
g_warning ("iPod's master playlist is missing");
}
@@ -183,6 +183,7 @@
RBiPodSource *source;
RBEntryView *songs;
RBiPodSourcePrivate *priv;
+ const Itdb_IpodInfo *info;
source = RB_IPOD_SOURCE (G_OBJECT_CLASS (rb_ipod_source_parent_class)->
constructor (type, n_construct_properties, construct_properties));
@@ -193,6 +194,14 @@
rb_entry_view_append_column (songs, RB_ENTRY_VIEW_COL_LAST_PLAYED, FALSE);
rb_ipod_load_songs (source);
+ info = itdb_device_get_ipod_info(priv->ipod_db->device);
+
+ if (info->ipod_generation == ITDB_IPOD_GENERATION_UNKNOWN ||
+ info->ipod_model == ITDB_IPOD_MODEL_SHUFFLE) {
+ priv->requires_itunessd = TRUE;
+ } else {
+ priv->requires_itunessd = FALSE;
+ }
return G_OBJECT (source);
}
@@ -911,7 +920,7 @@
}
static void
-itdb_schedule_save (Itdb_iTunesDB *db)
+itdb_schedule_save (Itdb_iTunesDB *db, gboolean write_itunessd)
{
/* FIXME: should probably be delayed a bit to avoid doing
* it after each file when we are copying several files
@@ -920,7 +929,11 @@
* have a timeout firing every 5 seconds and saving the db if it's
* dirty
*/
- itdb_write (db, NULL);
+ itdb_write (db, NULL);
+
+ if (write_itunessd) {
+ itdb_shuffle_write(db, NULL);
+ }
}
#ifdef ENABLE_IPOD_WRITING
@@ -972,7 +985,7 @@
song, -1);
add_ipod_song_to_db (isource, db, song);
- itdb_schedule_save (priv->ipod_db);
+ itdb_schedule_save (priv->ipod_db, priv->requires_itunessd);
}
g_object_unref (db);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]