diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-03-27 19:55:50 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-09-04 20:10:59 +0200 |
commit | eb40d86a586451ebd399428899c17ac66619f314 (patch) | |
tree | 8cebfdcf046b1024a9180070e95c451ee6f7d3a7 /nephilim/plugins | |
parent | 82fb2128be98f04ab403f192d5a42c7e2075d8f5 (diff) |
common: split MetadataFetcher into its own file
also fix finished() signal signature
Diffstat (limited to 'nephilim/plugins')
-rw-r--r-- | nephilim/plugins/AlbumCover.py | 7 | ||||
-rw-r--r-- | nephilim/plugins/Lyrics.py | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py index 8a26bc8..6de4519 100644 --- a/nephilim/plugins/AlbumCover.py +++ b/nephilim/plugins/AlbumCover.py @@ -21,7 +21,7 @@ from PyQt4.QtCore import pyqtSignal as Signal import os from ..plugin import Plugin -from .. import common +from .. import common, metadata_fetcher, song from .. import icons class AlbumCoverWidget(QtGui.QLabel): @@ -316,10 +316,11 @@ class AlbumCover(Plugin): def get_settings_widget(self): return self.SettingsWidgetAlbumCover(self) -class FetcherLastfm(common.MetadataFetcher): +class FetcherLastfm(metadata_fetcher.MetadataFetcher): name = 'Last.fm' def fetch(self, song): + self.song = song if not 'artist' in song or not 'album' in song: return self.finish() url = QtCore.QUrl('http://ws.audioscrobbler.com/2.0/') @@ -371,7 +372,7 @@ class FetcherLocal(QtCore.QObject): settings = None # SIGNALS - finished = Signal('song', 'metadata') + finished = Signal([song.Song, object]) def __init__(self, plugin): QtCore.QObject.__init__(self, plugin) diff --git a/nephilim/plugins/Lyrics.py b/nephilim/plugins/Lyrics.py index 4413b8e..30e18fa 100644 --- a/nephilim/plugins/Lyrics.py +++ b/nephilim/plugins/Lyrics.py @@ -22,7 +22,7 @@ import re from lxml import etree from ..plugin import Plugin -from .. import common +from .. import common, metadata_fetcher from .. import icons class LyricsWidget(QtGui.QWidget): @@ -300,7 +300,7 @@ class Lyrics(Plugin): self.__fetchers.append(fetcher(self)) self.__fetchers[-1].finished.connect(self.__new_lyrics_fetched) -class FetchLyricwiki(common.MetadataFetcher): +class FetchLyricwiki(metadata_fetcher.MetadataFetcher): name = 'Lyricwiki' __apiaddress = 'http://lyrics.wikia.com/api.php' @@ -364,7 +364,7 @@ class FetchLyricwiki(common.MetadataFetcher): lyrics += gr + '\n' self.finish(common.decode_htmlentities(lyrics)) -class FetchAnimelyrics(common.MetadataFetcher): +class FetchAnimelyrics(metadata_fetcher.MetadataFetcher): name = 'Animelyrics' def fetch(self, song): |