summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorg Schuler <jcsjcs@users.sourceforge.net>2005-11-13 05:13:10 +0000
committerJorg Schuler <jcsjcs@users.sourceforge.net>2005-11-13 05:13:10 +0000
commitd32962d49727317359846568f8641726fd55509d (patch)
tree5a729c49f10089cbda3efdbf69dfd80d71b120a8
parentdb54c3db957867c23252c22fbfcc15d5d6fdd248 (diff)
downloadlibgpod-d32962d49727317359846568f8641726fd55509d.tar.gz
libgpod-d32962d49727317359846568f8641726fd55509d.tar.xz
libgpod-d32962d49727317359846568f8641726fd55509d.zip
* 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
-rw-r--r--ChangeLog6
-rw-r--r--src/itdb.h8
-rw-r--r--src/itdb_itunesdb.c12
3 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 129788f..1e1e673 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2005-11-12 Jorg Schuler <jcsjcs at users.sourceforge.net>
+ * 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.
+
+2005-11-12 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
* src/itdb_track.c: (itdb_track_set_defaults) only change unk208
(audio/video) if not already set to non-zero.
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 <jcsjcs at users sourceforge net>
| 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 <jcsjcs at users sourceforge net>
| 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;