rhythmbox r5742 - in trunk: . plugins/ipod



Author: teuf
Date: Wed Jun 11 22:01:20 2008
New Revision: 5742
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5742&view=rev

Log:
* plugins/ipod/rb-ipod-source.c: (create_ipod_song_from_entry):
properly extract the year from the time_t we get from a
PROP_DURATION, this fixes bug #536194, before that patch, the year
on songs transferred to an ipod was set to a bogus value


Modified:
   trunk/ChangeLog
   trunk/plugins/ipod/rb-ipod-source.c

Modified: trunk/plugins/ipod/rb-ipod-source.c
==============================================================================
--- trunk/plugins/ipod/rb-ipod-source.c	(original)
+++ trunk/plugins/ipod/rb-ipod-source.c	Wed Jun 11 22:01:20 2008
@@ -465,6 +465,8 @@
 create_ipod_song_from_entry (RhythmDBEntry *entry, const char *mimetype)
 {
 	Itdb_Track *track;
+        gulong julian;
+        GDate *date;
 
 	track = itdb_track_new ();
 
@@ -479,7 +481,14 @@
 	track->cd_nr = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DISC_NUMBER);
 	track->track_nr = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_TRACK_NUMBER);
 	track->bitrate = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_BITRATE);
-	track->year = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DATE);
+        julian = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DATE);
+        date = g_date_new_julian (julian);
+        if (date != NULL) {
+                track->year = g_date_get_year (date);
+                g_date_free (date);
+        } else {
+                track->year = 0;
+        }
 	track->time_added = itdb_time_get_mac_time ();
 	track->time_played = rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_LAST_PLAYED);
 	track->time_played = itdb_time_host_to_mac (track->time_played);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]