From f8f3f19fa6402fe18c382184839583d0bba85d4a Mon Sep 17 00:00:00 2001 From: Jorg Schuler Date: Sun, 13 Nov 2005 05:13:10 +0000 Subject: * src/itdb_itunesdb.c: when new rating is set on the iPod, backup the old rating to app_rating. Not sure what it's for, but iTunes seem to do it. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1149 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/itdb.h | 8 ++++++-- src/itdb_itunesdb.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/itdb.h b/src/itdb.h index d039c61..33ba6f6 100644 --- a/src/itdb.h +++ b/src/itdb.h @@ -1,4 +1,4 @@ -/* Time-stamp: <2005-11-10 00:10:05 jcs> +/* Time-stamp: <2005-11-13 14:11:50 jcs> | | Copyright (C) 2002-2005 Jorg Schuler | Part of the gtkpod project. @@ -510,7 +510,11 @@ typedef struct guint32 recent_playcount; /* times track was played since last sync */ gboolean transferred; /* has file been transferred to iPod? */ gint16 BPM; /* supposed to vary the playback speed */ - guint8 app_rating; /* star rating set by appl. (not iPod) */ + guint8 app_rating; /* star rating set by appl. (not + * iPod). If the rating set on the iPod + and the rating field above differ, the + original rating is copied here and the + new rating is stored above. */ guint16 type; /* CBR MP3s are type 0x100, VBR MP3s are type 0x101, AAC are type 0x0 */ guint8 compilation; diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c index fd1a95a..c2b32e7 100644 --- a/src/itdb_itunesdb.c +++ b/src/itdb_itunesdb.c @@ -1,4 +1,4 @@ -/* Time-stamp: <2005-11-11 22:44:42 jcs> +/* Time-stamp: <2005-11-13 14:11:49 jcs> | | Copyright (C) 2002-2005 Jorg Schuler | Part of the gtkpod project. @@ -1930,8 +1930,14 @@ static glong get_mhit (FImport *fimp, glong mhit_seek) if (playcount) { if (playcount->rating != NO_PLAYCOUNT) - track->rating = playcount->rating; - + { + if (track->rating != playcount->rating) + { + /* backup original rating to app_rating */ + track->app_rating = track->rating; + track->rating = playcount->rating; + } + } if (playcount->time_played) track->time_played = playcount->time_played; -- cgit