commit 5b96378feded81cc3b9e9bd1a67149c3172a6541
Author: Christophe Fergeau <cferg...@mandriva.com>
Date:   Sat Mar 27 18:36:38 2010 +0100

    fix OnTheGo playlist parsing
    
    The 1st on the go playlist was always ignored

 src/itdb_itunesdb.c |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index 5f0b69a..96d1b9d 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -2660,42 +2660,32 @@ static gboolean read_OTG_playlists (FImport *fimp)
 {
     gchar *db[] = {"OTGPlaylistInfo", NULL};
     gchar *dirname, *otgname;
+    gint i=1;
 
     g_return_val_if_fail (fimp, FALSE);
     g_return_val_if_fail (fimp->itdb, FALSE);
     g_return_val_if_fail (fimp->itdb->filename, FALSE);
 
     dirname = g_path_get_dirname (fimp->itdb->filename);
-
     otgname = itdb_resolve_path (dirname, (const gchar **)db);
 
-
     /* only parse if "OTGPlaylistInfo" exists */
-    if (otgname)
+    while (otgname)
     {
-       gchar *filename;
-       gint i=1;
-       do
-       {
-           db[0] = g_strdup_printf ("OTGPlaylistInfo_%d", i);
-           filename = itdb_resolve_path (dirname, (const gchar **)db);
-           g_free (db[0]);
-           if (filename)
-           {
-               FContents *cts = fcontents_read (filename, &fimp->error);
-               if (cts)
-               {
-                   gchar *plname = g_strdup_printf (_("OTG Playlist %d"), i);
-                   process_OTG_file (fimp, cts, plname);
-                   g_free (plname);
-                   fcontents_free (cts);
-               }
-               g_free (filename);
-           }
-           if (fimp->error) break;
-           ++i;
-       } while (filename);
-       g_free (otgname);
+        FContents *cts = fcontents_read (otgname, &fimp->error);
+        if (cts)
+        {
+            gchar *plname = g_strdup_printf (_("OTG Playlist %d"), i);
+            process_OTG_file (fimp, cts, plname);
+            g_free (plname);
+            fcontents_free (cts);
+        }
+        g_free (otgname);
+        if (fimp->error) break;
+        db[0] = g_strdup_printf ("OTGPlaylistInfo_%d", i);
+        otgname = itdb_resolve_path (dirname, (const gchar **)db);
+        g_free (db[0]);
+        ++i;
     }
     g_free (dirname);
     return TRUE;

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to