mirror of
https://github.com/SoongNoonien/mpdevil.git
synced 2023-08-10 21:12:44 +03:00
do not hang on GLib error see: #14
This commit is contained in:
parent
13d7c2d36f
commit
52de223b0f
10
bin/mpdevil
10
bin/mpdevil
@ -40,7 +40,7 @@ import dbus.service
|
|||||||
from dbus.mainloop.glib import DBusGMainLoop
|
from dbus.mainloop.glib import DBusGMainLoop
|
||||||
DBusGMainLoop(set_as_default=True)
|
DBusGMainLoop(set_as_default=True)
|
||||||
|
|
||||||
VERSION="0.9.6" # sync with setup.py
|
VERSION="0.9.6-dev" # sync with setup.py
|
||||||
COVER_REGEX=r"^\.?(album|cover|folder|front).*\.(gif|jpeg|jpg|png)$"
|
COVER_REGEX=r"^\.?(album|cover|folder|front).*\.(gif|jpeg|jpg|png)$"
|
||||||
|
|
||||||
|
|
||||||
@ -1419,8 +1419,14 @@ class Cover(object):
|
|||||||
|
|
||||||
def get_pixbuf(self, size):
|
def get_pixbuf(self, size):
|
||||||
if self.path is None: # fallback needed
|
if self.path is None: # fallback needed
|
||||||
self.path=Gtk.IconTheme.get_default().lookup_icon("media-optical", size, Gtk.IconLookupFlags.FORCE_SVG).get_filename()
|
path=Gtk.IconTheme.get_default().lookup_icon("media-optical", size, Gtk.IconLookupFlags.FORCE_SVG).get_filename()
|
||||||
|
return GdkPixbuf.Pixbuf.new_from_file_at_size(path, size, size)
|
||||||
|
else:
|
||||||
|
try:
|
||||||
return GdkPixbuf.Pixbuf.new_from_file_at_size(self.path, size, size)
|
return GdkPixbuf.Pixbuf.new_from_file_at_size(self.path, size, size)
|
||||||
|
except: # load fallback if cover can't be loaded (GLib: Couldn’t recognize the image file format for file...)
|
||||||
|
path=Gtk.IconTheme.get_default().lookup_icon("media-optical", size, Gtk.IconLookupFlags.FORCE_SVG).get_filename()
|
||||||
|
return GdkPixbuf.Pixbuf.new_from_file_at_size(path, size, size)
|
||||||
|
|
||||||
###########
|
###########
|
||||||
# browser #
|
# browser #
|
||||||
|
Loading…
x
Reference in New Issue
Block a user