[gnome-music: 1/2] cached playlist total duration fix.



commit 0a424c39a4727db4ef48e1f1dba8c5ad8ee2ad4b
Author: Sai <suman sai14 gmail com>
Date:   Mon Aug 26 22:08:39 2013 +0530

    cached playlist total duration fix.

 gnomemusic/widgets.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/widgets.py b/gnomemusic/widgets.py
index c493b2e..8668ec2 100644
--- a/gnomemusic/widgets.py
+++ b/gnomemusic/widgets.py
@@ -312,9 +312,10 @@ class AlbumWidget(Gtk.EventBox):
         currentSong = playlist.get_value(currentIter, 5)
         song_passed = False
         _iter = playlist.get_iter_first()
+        self.duration = 0
         while _iter:
             song = playlist.get_value(_iter, 5)
-
+            self.duration += song.get_duration()
             escapedTitle = AlbumArtCache.get_media_title(song, True)
             if (song == currentSong):
                 title = '<b>%s</b>' % escapedTitle
@@ -330,6 +331,8 @@ class AlbumWidget(Gtk.EventBox):
             if(playlist.get_value(_iter, 7) != ERROR_ICON_NAME):
                 playlist.set_value(_iter, 9, iconVisible)
             _iter = playlist.iter_next(_iter)
+            self.ui.get_object('running_length_label_info').set_text(
+                '%d min' % (int(self.duration / 60) + 1))
         return False
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]