Revision: 2205
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=2205&view=rev
Author:   jcsjcs
Date:     2009-01-11 10:52:25 +0000 (Sun, 11 Jan 2009)

Log Message:
-----------
        * src/itdb_itunesdb.c (itdb_rename_files): remove the
          "iTunesStats" file used by Shuffles instead of the "Play Counts"
          file after writing the iTunesSD -- otherwise the playcounts are
          never reset. Thanks to Peter Maydell for pointing this
          out. Fixes tracker item #2481322.

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

Modified: libgpod/trunk/ChangeLog
===================================================================
--- libgpod/trunk/ChangeLog     2009-01-11 10:13:15 UTC (rev 2204)
+++ libgpod/trunk/ChangeLog     2009-01-11 10:52:25 UTC (rev 2205)
@@ -1,3 +1,11 @@
+2009-01-11  Jorg Schuler <jcsjcs at users.sourceforge.net>
+
+       * src/itdb_itunesdb.c (itdb_rename_files): remove the
+         "iTunesStats" file used by Shuffles instead of the "Play Counts"
+         file after writing the iTunesSD -- otherwise the playcounts are
+         never reset. Thanks to Peter Maydell for pointing this
+         out. Fixes tracker item #2481322.
+
 2009-01-06  Todd Zullinger  <tmzullinger at users.sourceforge.net>
 
        * po/zh_CN.po: Add simple Chinese translation (Tan Zhixin)

Modified: libgpod/trunk/src/itdb_itunesdb.c
===================================================================
--- libgpod/trunk/src/itdb_itunesdb.c   2009-01-11 10:13:15 UTC (rev 2204)
+++ libgpod/trunk/src/itdb_itunesdb.c   2009-01-11 10:52:25 UTC (rev 2205)
@@ -5582,11 +5582,13 @@
     const gchar *db_plc_o[] = {"Play Counts", NULL};
     const gchar *db_otg[] = {"OTGPlaylistInfo", NULL};
     const gchar *db_shu[] = {"iTunesShuffle", NULL};
+    const gchar *db_ist[] = {"iTunesStats", NULL};
     gchar *itunesdir;
     gchar *plcname_o;
     gchar *plcname_n;
     gchar *otgname;
     gchar *shuname;
+    gchar *istname;
     gboolean result = TRUE;
 
     g_return_val_if_fail (mp, FALSE);
@@ -5604,6 +5606,7 @@
                                         "Play Counts.bak", NULL);
     otgname = itdb_resolve_path (itunesdir, db_otg);
     shuname = itdb_resolve_path (itunesdir, db_shu);
+    istname = itdb_resolve_path (itunesdir, db_ist);
 
     /* rename "Play Counts" to "Play Counts.bak" */
     if (plcname_o)
@@ -5654,10 +5657,28 @@
        }
     }
 
+    /* remove some Shuffle files */
+    if (istname)
+    {
+       if (unlink (istname) == -1)
+       {
+           if (error && !*error)
+           {   /* don't overwrite previous error */
+           g_set_error (error,
+                        G_FILE_ERROR,
+                        g_file_error_from_errno (errno),
+                        _("Error removing '%s' (%s)."),
+                        istname, g_strerror (errno));
+           }
+           result = FALSE;
+       }
+    }
+
     g_free (plcname_o);
     g_free (plcname_n);
     g_free (otgname);
     g_free (shuname);
+    g_free (istname);
     g_free (itunesdir);
 
     return result;


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

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to