Ticket #4404: 0001-Play-the-next-stream-if-the-current-one-is-not-avail.patch

File 0001-Play-the-next-stream-if-the-current-one-is-not-avail.patch, 1.5 KB (added by humitos, 11 years ago)
  • activity.py

    From 695ef27ae0c8f86fa251dd4f8e3108c01d3f8ac4 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Mon, 4 Feb 2013 17:36:07 -0300
    Subject: [PATCH Jukebox] Play the next stream if the current one is not
     available SL #4404
    
    If we are playing a stream from the Journal and when it finishes the
    next one is an unavailable one, it's skipped and the next available
    stream is played.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     activity.py | 13 ++++++++-----
     1 file changed, 8 insertions(+), 5 deletions(-)
    
    diff --git a/activity.py b/activity.py
    index e3feb65..380cc2c 100644
    a b class JukeboxActivity(activity.Activity): 
    223223        self.playlist_widget._current_playing = index
    224224
    225225        path = self.playlist_widget._items[index]['path']
    226         if self.playlist_widget.is_from_journal(path):
    227             path = self.playlist_widget.get_path_from_journal(path)
    228         self.control.check_if_next_prev()
     226        if self.playlist_widget.check_available_media(path):
     227            if self.playlist_widget.is_from_journal(path):
     228                path = self.playlist_widget.get_path_from_journal(path)
     229            self.control.check_if_next_prev()
    229230
    230         self.player.set_uri(path)
    231         self.player.play()
     231            self.player.set_uri(path)
     232            self.player.play()
     233        else:
     234            self.songchange('next')
    232235
    233236    def __play_index_cb(self, widget, index, path):
    234237        # README: this line is no more necessary because of the