Update of /cvsroot/gtkpod/libgpod/src
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv30394/src

Modified Files:
        itdb_itunesdb.c 
Log Message:
        * src/itdb_itunesdb.c (itdb_init_ipod): only write iTunesSD
          (shuffle database) when initializing shuffle. Thanks to
          James Joyce for the patch.



Index: itdb_itunesdb.c
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/src/itdb_itunesdb.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- itdb_itunesdb.c     28 Jun 2006 15:13:49 -0000      1.65
+++ itdb_itunesdb.c     2 Jul 2006 04:47:36 -0000       1.66
@@ -1,4 +1,4 @@
-/* Time-stamp: <2006-06-29 00:11:00 jcs>
+/* Time-stamp: <2006-07-02 13:26:31 jcs>
 |
 |  Copyright (C) 2002-2005 Jorg Schuler <jcsjcs at users sourceforge net>
 |  Part of the gtkpod project.
@@ -5486,6 +5486,7 @@
        gboolean writeok;
        Itdb_iTunesDB *itdb = NULL;
        Itdb_Playlist *mpl = NULL;
+       Itdb_IpodInfo const *info = NULL;
        gchar *path;
        
        g_return_val_if_fail (mountpoint, FALSE);
@@ -5496,7 +5497,6 @@
        /* Assign iPod device reference to new database */
        itdb_set_mountpoint(itdb, mountpoint);
        
-
        /* Insert model_number into sysinfo file if present
         * The model number can be extracted in a couple of ways:
         *              - use the read_sysinfo_file function
@@ -5545,18 +5545,26 @@
        }
        g_free (path);
 
-       path = itdb_get_itunessd_path (mountpoint);
-       if (!path)
+       /* Retrieve the model from the device information */
+       info = itdb_device_get_ipod_info(itdb->device);
+    
+       /* If model is a shuffle or the model is undetermined,
+        * ie. @model_number is NULL, then create the itunesSD database
+        */
+       if(!model_number || info->ipod_model == ITDB_IPOD_MODEL_SHUFFLE)
        {
-           writeok = itdb_shuffle_write(itdb, error);
-           if(! writeok)
+           path = itdb_get_itunessd_path (mountpoint);
+           if (!path)
            {
-               itdb_free (itdb);
-               return FALSE;
+               writeok = itdb_shuffle_write(itdb, error);
+               if(! writeok)
+               {
+                   itdb_free (itdb);
+                   return FALSE;
+               }
            }
+           g_free (path);
        }
-       g_free (path);
-       
        itdb_free (itdb);
        return TRUE;
 }


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to