[gnome-music] mpris: skip all the exception when fetching track info
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] mpris: skip all the exception when fetching track info
- Date: Sat, 29 Mar 2014 20:08:31 +0000 (UTC)
commit c42c36c79638fef290abccb400381ca73d070100
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Sat Mar 29 21:07:21 2014 +0100
mpris: skip all the exception when fetching track info
https://bugzilla.gnome.org/show_bug.cgi?id=726721
gnomemusic/mpris.py | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 20c085f..e41354b 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -85,45 +85,45 @@ class MediaPlayer2Service(dbus.service.Object):
length = dbus.Int64(media.get_duration() * 1000000)
assert length is not None
metadata['mpris:length'] = length
- except (AssertionError, ValueError):
+ except:
pass
try:
trackNumber = media.get_track_number()
assert trackNumber is not None
metadata['xesam:trackNumber'] = trackNumber
- except (AssertionError, ValueError):
+ except:
pass
try:
useCount = media.get_play_count()
assert useCount is not None
metadata['xesam:useCount'] = useCount
- except (AssertionError, ValueError):
+ except:
pass
try:
userRating = media.get_rating()
assert userRating is not None
metadata['xesam:userRating'] = userRating
- except (AssertionError, ValueError):
+ except:
pass
try:
title = AlbumArtCache.get_media_title(media)
assert title is not None
metadata['xesam:title'] = title
- except (AssertionError, ValueError):
+ except:
pass
try:
album = media.get_album()
assert album is not None
- except (AssertionError, ValueError):
+ except:
try:
album = media.get_string(Grl.METADATA_KEY_ALBUM)
assert album is not None
- except (AssertionError, ValueError):
+ except:
album = _("Unknown Album")
finally:
metadata['xesam:album'] = album
@@ -131,11 +131,11 @@ class MediaPlayer2Service(dbus.service.Object):
try:
artist = media.get_artist()
assert artist is not None
- except (AssertionError, ValueError):
+ except:
try:
artist = media.get_string(Grl.METADATA_KEY_ARTIST)
assert artist is not None
- except (AssertionError, ValueError):
+ except:
try:
artist = media.get_author()
assert artist is not None
@@ -149,21 +149,21 @@ class MediaPlayer2Service(dbus.service.Object):
genre = media.get_genre()
assert genre is not None
metadata['xesam:genre'] = genre
- except (AssertionError, ValueError):
+ except:
pass
try:
lastUsed = media.get_last_played()
assert genre is not None
metadata['xesam:lastUsed'] = lastUsed
- except (AssertionError, ValueError):
+ except:
pass
try:
artUrl = media.get_thumbnail()
assert genre is not None
metadata['mpris:artUrl'] = artUrl
- except (AssertionError, ValueError):
+ except:
pass
return metadata
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]