[gnome-music] player: fix remote files playback



commit b0def48ed09f75b0627fed28d9976a181d7d61af
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Fri Feb 20 00:32:56 2015 +0100

    player: fix remote files playback
    
    Pass a proper function to GLib.idle_add, remove semicolons
    and don't try to discover remote URLs

 INSTALL              |    4 ++--
 gnomemusic/player.py |   14 +++++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index 007e939..2099840 100644
--- a/INSTALL
+++ b/INSTALL
@@ -12,8 +12,8 @@ without warranty of any kind.
 Basic Installation
 ==================
 
-   Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
+   Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.  Some packages provide this
 `INSTALL' file but do not implement all of the features documented
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 20c05fe..7169681 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -472,12 +472,12 @@ class Player(GObject.GObject):
         self.emit('playlist-item-changed', self.playlist, currentTrack)
         self.emit('current-changed')
 
-        self._validate_next_track();
+        self._validate_next_track()
 
     def _on_next_item_validated(self, info, error, _iter):
         if error:
             print("Info %s: error: %s" % (info, error))
-            self.playlist.set_value(_iter, self.discovery_status_field, DiscoveryStatus.FAILED);
+            self.playlist.set_value(_iter, self.discovery_status_field, DiscoveryStatus.FAILED)
             nextTrack = self.playlist.iter_next(_iter)
 
             if nextTrack:
@@ -495,13 +495,17 @@ class Player(GObject.GObject):
         _iter = self.playlist.get_iter(self.nextTrack.get_path())
         status = self.playlist.get_value(_iter, self.discovery_status_field)
         nextSong = self.playlist.get_value(_iter, self.playlistField)
+        url = self.playlist.get_value(_iter, 5).get_url()
 
-        if status == DiscoveryStatus.PENDING:
+        # Skip remote tracks discovery
+        if url.startswith("http://";):
+            status = DiscoveryStatus.SUCCEEDED
+        elif status == DiscoveryStatus.PENDING:
             self.discover_item(nextSong, self._on_next_item_validated, _iter)
         elif status == DiscoveryStatus.FAILED:
-            GLib.idle_add(self._validate_next_track())
+            GLib.idle_add(self._validate_next_track)
 
-        return False;
+        return False
 
     @log
     def _on_cache_lookup(self, pixbuf, path, data=None):


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