Revision: 1971
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1971&view=rev
Author:   jcsjcs
Date:     2008-05-11 00:17:29 -0700 (Sun, 11 May 2008)

Log Message:
-----------
        * src/itdb_photoalbum.c
          src/itdb_private.h
          src/db-artwork-writer.c: renamed itdb_get_free_photo_id() to
          itdb_get_max_photo_id() and implemented Jacob Hoffman-Andrew's
          patch about the photo_ids and album_ids being shared.

        * tests/test-covers.c: print more info (marginally)

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/db-artwork-writer.c
    libgpod/trunk/src/itdb_photoalbum.c
    libgpod/trunk/src/itdb_private.h
    libgpod/trunk/tests/test-covers.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2008-05-11 06:07:12 UTC (rev 1970)
+++ libgpod/trunk/ChangeLog     2008-05-11 07:17:29 UTC (rev 1971)
@@ -1,3 +1,13 @@
+2008-05-11  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+        * src/itdb_photoalbum.c
+         src/itdb_private.h
+         src/db-artwork-writer.c: renamed itdb_get_free_photo_id() to
+         itdb_get_max_photo_id() and implemented Jacob Hoffman-Andrew's
+         patch about the photo_ids and album_ids being shared.
+
+       * tests/test-covers.c: print more info (marginally)
+
 2008-05-10  Jorg Schuler <jcsjcs at users.sourceforge.net>
 
        * tests/test-covers.c: print more status messages.
@@ -2,3 +12,2 @@
 
-
 2008-05-01  Todd Zullinger  <tmzullinger at users.sourceforge.net>

Modified: libgpod/trunk/src/db-artwork-writer.c
===================================================================
--- libgpod/trunk/src/db-artwork-writer.c       2008-05-11 06:07:12 UTC (rev 
1970)
+++ libgpod/trunk/src/db-artwork-writer.c       2008-05-11 07:17:29 UTC (rev 
1971)
@@ -1086,8 +1086,8 @@
                g_free (filename);
                return -1;
        }
-       id_max = itdb_get_free_photo_id( photodb );
-       bytes_written = write_mhfd (&db, buf, id_max);
+       id_max = itdb_get_max_photo_id( photodb );
+       bytes_written = write_mhfd (&db, buf, id_max+1);
 
        /* Refcount of the shared buffer should drop to 0 and this should
         * sync buffered data to disk

Modified: libgpod/trunk/src/itdb_photoalbum.c
===================================================================
--- libgpod/trunk/src/itdb_photoalbum.c 2008-05-11 06:07:12 UTC (rev 1970)
+++ libgpod/trunk/src/itdb_photoalbum.c 2008-05-11 07:17:29 UTC (rev 1971)
@@ -309,19 +309,26 @@
 
 
 
-G_GNUC_INTERNAL gint itdb_get_free_photo_id ( Itdb_PhotoDB *db ) 
+G_GNUC_INTERNAL gint itdb_get_max_photo_id ( Itdb_PhotoDB *db ) 
 {
-       gint photo_id = 0;
+       gint max_seen_id = 0;
        GList *it;
 
        for (it = db->photos; it != NULL; it = it->next) {
                Itdb_Artwork *artwork;
 
                artwork = (Itdb_Artwork *)it->data;
-               if( artwork->id > photo_id )
-                       photo_id = artwork->id;
+               if( artwork->id > max_seen_id )
+                       max_seen_id = artwork->id;
        }
-       return photo_id + 1;
+        for (it = db->photoalbums; it != NULL; it = it->next) {
+               Itdb_PhotoAlbum *album;
+               album = (Itdb_PhotoAlbum *)it->data;
+               if ( album->album_id > max_seen_id )
+                       max_seen_id = album->album_id;
+               
+       }
+       return max_seen_id;
 }
 
 static void itdb_photodb_photoalbum_free (Itdb_PhotoAlbum *album)

Modified: libgpod/trunk/src/itdb_private.h
===================================================================
--- libgpod/trunk/src/itdb_private.h    2008-05-11 06:07:12 UTC (rev 1970)
+++ libgpod/trunk/src/itdb_private.h    2008-05-11 07:17:29 UTC (rev 1971)
@@ -146,7 +146,7 @@
 G_GNUC_INTERNAL const gchar *itdb_photodb_get_mountpoint (Itdb_PhotoDB 
*photodb);
 G_GNUC_INTERNAL gchar *db_get_mountpoint (Itdb_DB *db);
 G_GNUC_INTERNAL Itdb_Device *db_get_device(Itdb_DB *db);
-G_GNUC_INTERNAL gint itdb_get_free_photo_id ( Itdb_PhotoDB *db );
+G_GNUC_INTERNAL gint itdb_get_max_photo_id ( Itdb_PhotoDB *db );
 G_GNUC_INTERNAL Itdb_iTunesDB *db_get_itunesdb (Itdb_DB *db);
 G_GNUC_INTERNAL Itdb_PhotoDB *db_get_photodb (Itdb_DB *db);
 G_GNUC_INTERNAL gint itdb_thumb_get_byteorder (ItdbThumbFormat format);

Modified: libgpod/trunk/tests/test-covers.c
===================================================================
--- libgpod/trunk/tests/test-covers.c   2008-05-11 06:07:12 UTC (rev 1970)
+++ libgpod/trunk/tests/test-covers.c   2008-05-11 07:17:29 UTC (rev 1971)
@@ -80,7 +80,7 @@
                Itdb_Track *song;
                
                song = (Itdb_Track *)it->data;
-               g_print ("Track %d\n", count++);
+               g_print ("Track %d (%016"G_GINT64_MODIFIER"x)\n", count++, 
song->dbid);
                save_song_thumbnails (song);
        }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to