本文整理匯總了Python中lollypop.cache.InfoCache.uncache_artwork方法的典型用法代碼示例。如果您正苦於以下問題:Python InfoCache.uncache_artwork方法的具體用法?Python InfoCache.uncache_artwork怎麽用?Python InfoCache.uncache_artwork使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類lollypop.cache.InfoCache
的用法示例。
在下文中一共展示了InfoCache.uncache_artwork方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _on_button_clicked
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def _on_button_clicked(self, button):
"""
Show file chooser
@param button as Gtk.button
"""
dialog = Gtk.FileChooserDialog()
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)
dialog.add_buttons(Gtk.STOCK_OPEN, Gtk.ResponseType.OK)
dialog.set_transient_for(Lp().window)
self.__close_popover()
response = dialog.run()
if response == Gtk.ResponseType.OK:
try:
f = Lio.File.new_for_path(dialog.get_filename())
(status, data, tag) = f.load_contents()
if not status:
raise
if self.__album is not None:
Lp().art.save_album_artwork(data, self.__album.id)
else:
for suffix in ["lastfm", "wikipedia", "spotify"]:
InfoCache.uncache_artwork(self.__artist, suffix,
button.get_scale_factor())
InfoCache.add(self.__artist, None, data, suffix)
Lp().art.emit('artist-artwork-changed', self.__artist)
self._streams = {}
except Exception as e:
print("ArtworkSearch::_on_button_clicked():", e)
dialog.destroy()
示例2: __really_update_coversize
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def __really_update_coversize(self, widget):
"""
Update cover size
@param widget as Gtk.Range
"""
self.__cover_tid = None
value = widget.get_value()
Lp().settings.set_value('cover-size', GLib.Variant('i', value))
Lp().art.update_art_size()
for suffix in ["lastfm", "wikipedia", "spotify"]:
for artist in Lp().artists.get([]):
InfoCache.uncache_artwork(artist[1], suffix,
widget.get_scale_factor())
Lp().art.emit('artist-artwork-changed', artist[1])
Lp().window.reload_view()
示例3: _on_reset_confirm
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def _on_reset_confirm(self, button):
"""
Reset cover
@param button as Gtk.Button
"""
self._infobar.hide()
if self._album is not None:
Lp().art.remove_album_artwork(self._album)
Lp().art.clean_album_cache(self._album)
Lp().art.emit('album-artwork-changed', self._album.id)
else:
for suffix in ["lastfm", "wikipedia", "spotify"]:
InfoCache.uncache_artwork(self._artist, suffix,
button.get_scale_factor())
Lp().art.emit('artist-artwork-changed', self._artist)
self._close_popover()
示例4: _on_activate
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def _on_activate(self, flowbox, child):
"""
Use pixbuf as cover
Reset cache and use player object to announce cover change
"""
data = self._datas[child.get_child()]
self._close_popover()
if self._album is not None:
Lp().art.save_album_artwork(data, self._album.id)
Lp().art.clean_album_cache(self._album)
Lp().art.album_artwork_update(self._album.id)
else:
for suffix in ["lastfm", "wikipedia", "spotify"]:
InfoCache.uncache_artwork(self._artist, suffix,
flowbox.get_scale_factor())
InfoCache.cache(self._artist, None, data, suffix)
self._streams = {}
示例5: _really_update_coversize
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def _really_update_coversize(self, widget):
"""
Update cover size
@param widget as Gtk.Range
"""
self._cover_tid = None
value = widget.get_value()
Lp().settings.set_value('cover-size', GLib.Variant('i', value))
ArtSize.BIG = value
for suffix in ["lastfm", "wikipedia", "spotify"]:
for artist in Lp().artists.get([]):
InfoCache.uncache_artwork(artist[1], suffix,
widget.get_scale_factor())
Lp().art.emit('artist-artwork-changed', artist[1])
# For a 200 album artwork, we want a 60 artist artwork
ArtSize.ARTIST_SMALL = ArtSize.BIG * 60 / 200
Lp().window.reload_view()
示例6: __on_activate
# 需要導入模塊: from lollypop.cache import InfoCache [as 別名]
# 或者: from lollypop.cache.InfoCache import uncache_artwork [as 別名]
def __on_activate(self, flowbox, child):
"""
Use pixbuf as cover
Reset cache and use player object to announce cover change
"""
try:
data = self.__datas[child.get_child()]
self.__close_popover()
if self.__album is not None:
Lp().art.save_album_artwork(data, self.__album.id)
else:
for suffix in ["lastfm", "wikipedia", "spotify"]:
InfoCache.uncache_artwork(self.__artist, suffix,
flowbox.get_scale_factor())
InfoCache.add(self.__artist, None, data, suffix)
Lp().art.emit('artist-artwork-changed', self.__artist)
self._streams = {}
except:
self._infobar_label.set_text(_("Reset artwork?"))
self._infobar.show()
# GTK 3.20 https://bugzilla.gnome.org/show_bug.cgi?id=710888
self._infobar.queue_resize()