rpms/gtkpod/devel gtkpod-0.99.10-spl-tracklen.patch, NONE, 1.1 gtkpod.spec, 1.2, 1.3

Todd M. Zullinger (tmz) fedora-extras-commits at redhat.com
Wed Nov 21 17:25:35 UTC 2007


Author: tmz

Update of /cvs/pkgs/rpms/gtkpod/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17037

Modified Files:
	gtkpod.spec 
Added Files:
	gtkpod-0.99.10-spl-tracklen.patch 
Log Message:
* Wed Nov 21 2007 Todd Zullinger <tmz at pobox.com> - 0.99.10-2
- rebuild for libgpod-0.6.0
- apply upstream patch to fix smart playlist play time bug
- Requires: which (used in some of the provided scripts)


gtkpod-0.99.10-spl-tracklen.patch:

--- NEW FILE gtkpod-0.99.10-spl-tracklen.patch ---
Index: src/display_spl.c
===================================================================
--- src/display_spl.c	(revision 1797)
+++ src/display_spl.c	(revision 1798)
@@ -91,7 +91,7 @@
     { ITDB_SPLFIELD_DATE_MODIFIED,  N_("Date modified") },
     { ITDB_SPLFIELD_TRACKNUMBER,    N_("Track number") },
     { ITDB_SPLFIELD_SIZE,           N_("Size") },
-    { ITDB_SPLFIELD_TIME,           N_("Time") },
+    { ITDB_SPLFIELD_TIME,           N_("Play time") },
     { ITDB_SPLFIELD_COMMENT,        N_("Comment") },
     { ITDB_SPLFIELD_DATE_ADDED,     N_("Date added") },
     { ITDB_SPLFIELD_COMPOSER,       N_("Composer") },
@@ -635,10 +635,17 @@
     switch (type)
     {
     case spl_ET_FROMVALUE:
-	splr->fromvalue = atol (str);
-	if (splr->field == ITDB_SPLFIELD_RATING)
+	switch (splr->field)
 	{
-	    splr->fromvalue *= ITDB_RATING_STEP;
+	case ITDB_SPLFIELD_RATING:
+	    splr->fromvalue = ITDB_RATING_STEP * atol (str);
+	    break;
+	case ITDB_SPLFIELD_TIME:
+	    splr->fromvalue = 1000 * strtod (str, NULL);
+	    break;
+	default:
+	    splr->fromvalue = atol (str);
+	    break;
 	}
 	break;
     case spl_ET_FROMVALUE_DATE:
@@ -650,10 +657,17 @@
 	splr->fromdate = atol (str);
 	break;
     case spl_ET_TOVALUE:
-	splr->tovalue = atol (str);
-	if (splr->field == ITDB_SPLFIELD_RATING)
+	switch (splr->field)
 	{
-	    splr->tovalue *= ITDB_RATING_STEP;
+	case ITDB_SPLFIELD_RATING:
+	    splr->tovalue = ITDB_RATING_STEP * atol (str);
+	    break;
+	case ITDB_SPLFIELD_TIME:
+	    splr->tovalue = 1000 * strtod (str, NULL);
+	    break;
+	default:
+	    splr->tovalue = atol (str);
+	    break;
 	}
 	break;
     case spl_ET_TOVALUE_DATE:
@@ -1004,22 +1018,27 @@
 			       enum entrytype et)
 {
     gchar *strp = str;
-    gint stepsize = 1; /* for FROMVALUE/TOVALUE (20 for rating) */
 
     g_return_val_if_fail (str, NULL);
     g_return_val_if_fail (splr, NULL);
 
-    if (splr->field == ITDB_SPLFIELD_RATING)
-    {
-	stepsize = ITDB_RATING_STEP;
-    }
-
     switch (et)
     {
     case spl_ET_FROMVALUE:
 	if (splr->fromvalue == ITDB_SPL_DATE_IDENTIFIER)
 	    splr->fromvalue = 0;
-	snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue / stepsize));
+	switch (splr->field)
+	{
+	case ITDB_SPLFIELD_RATING:
+	    snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue / ITDB_RATING_STEP));
+	    break;
+	case ITDB_SPLFIELD_TIME:
+	    snprintf (str, WNLEN, "%.10g", ((gdouble)splr->fromvalue/1000));
+	    break;
+	default:
+	    snprintf (str, WNLEN, "%lld", (long long int)(splr->fromvalue));
+	    break;
+	}
 	break;
     case spl_ET_FROMVALUE_DATE:
 	if (splr->fromvalue == ITDB_SPL_DATE_IDENTIFIER)
@@ -1032,7 +1051,18 @@
     case spl_ET_TOVALUE:
 	if (splr->tovalue == ITDB_SPL_DATE_IDENTIFIER)
 	    splr->tovalue = 0;
-	snprintf (str, WNLEN, "%lld",  (long long int)(splr->tovalue / stepsize));
+	switch (splr->field )
+	{
+	case ITDB_SPLFIELD_RATING:
+	    snprintf (str, WNLEN, "%lld",  (long long int)(splr->tovalue / ITDB_RATING_STEP));
+	    break;
+	case ITDB_SPLFIELD_TIME:
+	    snprintf (str, WNLEN, "%.10g", ((gdouble)splr->tovalue/1000));
+	    break;
+	default:
+	    snprintf (str, WNLEN, "%lld", (long long int)(splr->tovalue));
+	    break;
+	}
 	break;
     case spl_ET_TOVALUE_DATE:
 	if (splr->tovalue == ITDB_SPL_DATE_IDENTIFIER)


Index: gtkpod.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gtkpod/devel/gtkpod.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- gtkpod.spec	5 Aug 2007 16:15:55 -0000	1.2
+++ gtkpod.spec	21 Nov 2007 17:25:03 -0000	1.3
@@ -1,12 +1,13 @@
 Name:           gtkpod
 Version:        0.99.10
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Graphical song management program for Apple's iPod
 
 Group:          Applications/Multimedia
 License:        GPLv2+
 URL:            http://www.gtkpod.org
 Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Patch0:         gtkpod-0.99.10-spl-tracklen.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  curl-devel
@@ -18,12 +19,15 @@
 BuildRequires:  hal-devel
 BuildRequires:  libglade2-devel
 BuildRequires:  libgnomecanvas-devel
-BuildRequires:  libgpod-devel >= 0.5.2
+BuildRequires:  libgpod-devel >= 0.6.0
 BuildRequires:  libid3tag-devel
 BuildRequires:  libmp4v2-devel
 BuildRequires:  libvorbis-devel
 BuildRequires:  perl(XML::Parser)
 
+# some of the scripts in %{_datadir}/%{name}/scripts use which
+Requires:       which
+
 %description
 gtkpod is a platform independent Graphical User Interface for Apple's
 iPod using GTK2. It supports the first to fifth Generation including
@@ -32,6 +36,7 @@
 
 %prep
 %setup -q
+%patch -p0 -b .spl-tracklen
 
 
 %build
@@ -80,6 +85,11 @@
 
 
 %changelog
+* Wed Nov 21 2007 Todd Zullinger <tmz at pobox.com> - 0.99.10-2
+- rebuild for libgpod-0.6.0
+- apply upstream patch to fix smart playlist play time bug
+- Requires: which (used in some of the provided scripts)
+
 * Sat Aug 04 2007 Todd Zullinger <tmz at pobox.com> - 0.99.10-1
 - update to 0.99.10
 - use upstream .desktop file




More information about the fedora-extras-commits mailing list