[gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Remove pointless try/except
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/player-factor-out-gstreamer] player: Remove pointless try/except
- Date: Sun, 18 Feb 2018 15:53:43 +0000 (UTC)
commit cfa8ae3415d99dc694a25a4dce9be8a608de2340
Author: Marinus Schraal <mschraal gnome org>
Date: Sun Feb 18 00:44:27 2018 +0100
player: Remove pointless try/except
gnomemusic/player.py | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 7c984c1..73112d9 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -646,22 +646,17 @@ class Player(GObject.GObject):
if position > 0:
self.played_seconds += self._seconds_period / 1000
- try:
- percentage = tick / duration
- if (not self._lastfm.scrobbled
- and duration > 30
- and (percentage > 0.5 or tick > 4*60)):
- if current_media:
- # FIXME: we should not need to update static
- # playlists here but removing it may introduce
- # a bug. So, we keep it for the time being.
- playlists.update_all_static_playlists()
- grilo.bump_play_count(current_media)
- grilo.set_last_played(current_media)
- self._lastfm.scrobble(current_media, self._time_stamp)
-
- except Exception as e:
- logger.warn("Error: %s, %s", e.__class__, e)
+ percentage = tick / duration
+ if (not self._lastfm.scrobbled
+ and duration > 30
+ and (percentage > 0.5 or tick > 4*60)):
+ # FIXME: we should not need to update static
+ # playlists here but removing it may introduce
+ # a bug. So, we keep it for the time being.
+ playlists.update_all_static_playlists()
+ grilo.bump_play_count(current_media)
+ grilo.set_last_played(current_media)
+ self._lastfm.scrobble(current_media, self._time_stamp)
@log
def _on_play_button_clicked(self, button):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]