Revision: 1549
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1549&view=rev
Author:   jcsjcs
Date:     2007-06-17 01:44:07 -0700 (Sun, 17 Jun 2007)

Log Message:
-----------
        * src/itdb_itunesdb.c
          src/itdb.h: libgpod will not change the values for sort_artist.
          Furthermore, libgpod reads the stored values of
          sort_artist/_album... from the iTunesDB and makes them available
          through the Itdb_Track structure. Applications should modify
          these values along with the corresponding artist/album... fields
          if a particular sort order is required.

Modified Paths:
--------------
    libgpod/trunk/ChangeLog
    libgpod/trunk/src/itdb.h
    libgpod/trunk/src/itdb_itunesdb.c

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2007-06-14 14:01:58 UTC (rev 1548)
+++ libgpod/trunk/ChangeLog     2007-06-17 08:44:07 UTC (rev 1549)
@@ -1,3 +1,13 @@
+2007-06-17 Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+       * src/itdb_itunesdb.c
+         src/itdb.h: libgpod will not change the values for sort_artist.
+         Furthermore, libgpod reads the stored values of
+         sort_artist/_album... from the iTunesDB and makes them available
+         through the Itdb_Track structure. Applications should modify
+         these values along with the corresponding artist/album... fields
+         if a particular sort order is required.
+
 2007-06-14 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
        * po/es.po: new version updated by Alejandro Lamas DaviƱa.

Modified: libgpod/trunk/src/itdb.h
===================================================================
--- libgpod/trunk/src/itdb.h    2007-06-14 14:01:58 UTC (rev 1548)
+++ libgpod/trunk/src/itdb.h    2007-06-17 08:44:07 UTC (rev 1549)
@@ -723,27 +723,26 @@
   gchar   *albumartist;      /* see note for MHOD_ID in itdb_itunesdb.c */
   gchar   *keywords;         /* see note for MHOD_ID in itdb_itunesdb.c */
 /* the following 6 are new in libgpod 0.5.0... */
-  /* You can set these strings to override the standard sortorder
-     suggested by libgpod. When set they take precedence over the
-     default 'artist', 'album'... fields.
+  /* You can set these strings to override the standard
+     sortorder. When set they take precedence over the default
+     'artist', 'album'... fields.
 
-     When reading the iTunesDB these fields are discarded, so you will
-     have to set them again before writing the iTunesDB.
+     For example, in the case of an artist name like "The Artist",
+     iTunes will set sort_artist to "Artist, The" followed by five
+     0x01 characters. Why five 0x01 characters are added is not
+     completely understood.
 
-     libgpod will automatically create an entry in the iTunesDB (but
-     not below) for sort_artist if 'artist' is something like "The
-     Artist" and sort_artist wasn't set by the application. In that
-     case 'Artist, The' followed by five 0x01 characters is used for
-     sorting and written to the iTunesDB. Why five 0x01 characters are
-     added is not completely understood, but analogous to what iTunes
-     does. libgpod will _not_ change the six fields below, however. */
-  gchar   *sort_artist;      /* artist name (for sorting)               */
+     If you do not set the sort_artist field, libgpod will pre-sort
+     the lists displayed by the iPod according to "Artist, The",
+     without setting the field.
+  */
+  gchar   *sort_artist;      /* artist (for sorting)                    */
   gchar   *sort_title;       /* title (for sorting)                     */
   gchar   *sort_album;       /* album (for sorting)                     */
   gchar   *sort_albumartist; /* album artist (for sorting)              */
   gchar   *sort_composer;    /* composer (for sorting)                  */
   gchar   *sort_tvshow;      /* tv show (for sorting)                   */
-/* ... to here */
+/* new fields in libgpod 0.5.0 up to here */
   guint32 id;                /* unique ID of track                      */
   gint32  size;              /* size of file in bytes                   */
   gint32  tracklen;          /* Length of track in ms                   */

Modified: libgpod/trunk/src/itdb_itunesdb.c
===================================================================
--- libgpod/trunk/src/itdb_itunesdb.c   2007-06-14 14:01:58 UTC (rev 1548)
+++ libgpod/trunk/src/itdb_itunesdb.c   2007-06-17 08:44:07 UTC (rev 1549)
@@ -2371,15 +2371,22 @@
              track->keywords = entry_utf8;
              break;
          case MHOD_ID_SORT_ARTIST:
+             track->sort_artist = entry_utf8;
+             break;
          case MHOD_ID_SORT_TITLE:
+             track->sort_title = entry_utf8;
+             break;
          case MHOD_ID_SORT_ALBUM:
+             track->sort_album = entry_utf8;
+             break;
          case MHOD_ID_SORT_ALBUMARTIST:
+             track->sort_albumartist = entry_utf8;
+             break;
          case MHOD_ID_SORT_COMPOSER:
+             track->sort_composer = entry_utf8;
+             break;
          case MHOD_ID_SORT_TVSHOW:
-             /* we don't read those -- the application has to set
-                them before each export / libgpod will create the
-                sort_artist field before each export if not set */
-             g_free (entry_utf8);
+             track->sort_tvshow = entry_utf8;
              break;
          case MHOD_ID_SPLPREF:
          case MHOD_ID_SPLRULES:
@@ -4209,7 +4216,6 @@
        guint32 mhod_num = 0;
        gulong mhit_seek = cts->pos;
        MHODData mhod;
-       gchar *str;
 
        g_return_val_if_fail (track, FALSE);
 
@@ -4349,14 +4355,12 @@
            mk_mhod (fexp, &mhod);
            ++mhod_num;
        }
-       str = get_sort_artist (track);
-       if (str)
+       if (track->sort_artist && *track->sort_artist)
        {
            mhod.type = MHOD_ID_SORT_ARTIST;
-           mhod.data.string = str;
+           mhod.data.string = track->sort_artist;
            mk_mhod (fexp, &mhod);
            ++mhod_num;
-           g_free (str);
        }
        if (track->sort_title && *track->sort_title)
        {


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 DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to