diff options
author | Anton Khirnov <wyskas@gmail.com> | 2009-08-24 20:46:27 +0200 |
---|---|---|
committer | Anton Khirnov <wyskas@gmail.com> | 2009-08-24 20:46:27 +0200 |
commit | e4f46487145be0bbcd2aa278388a1b4b3ef78f54 (patch) | |
tree | 4e0170664bdc651c782601544572170d20090239 /nephilim/plugins/Lyrics.py | |
parent | e7c01e7b53f02b24e6938d945e84453537f3fa31 (diff) |
song: convert to a subclass of dict.
also don't store whole song in Library and Playlist,
this saves a significant amount of memory.
Diffstat (limited to 'nephilim/plugins/Lyrics.py')
-rw-r--r-- | nephilim/plugins/Lyrics.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nephilim/plugins/Lyrics.py b/nephilim/plugins/Lyrics.py index 9217df8..3b6224f 100644 --- a/nephilim/plugins/Lyrics.py +++ b/nephilim/plugins/Lyrics.py @@ -91,7 +91,7 @@ class LyricsWidget(QtGui.QWidget): self.__text_view.clear() self.__label.setText('<b>%s</b> by <u>%s</u> on <u>%s</u>'\ - %(song.title(), song.artist(), song.album())) + %(song['title'], song['artist'], song['album'])) if lyrics: self.logger.info('Setting new lyrics.') self.__text_view.insertPlainText(lyrics.decode('utf-8')) @@ -147,7 +147,7 @@ class Lyrics(Plugin): def fetch(self, song): url = QtCore.QUrl('http://lyricwiki.org/api.php') - url.setQueryItems([('func', 'getArtist'), ('artist', song.artist()), + url.setQueryItems([('func', 'getArtist'), ('artist', song['artist']), ('fmt', 'xml')]) self.fetch2(song, url) self.rep.finished.connect(self.__handle_artist_res) @@ -167,7 +167,7 @@ class Lyrics(Plugin): url = QtCore.QUrl('http://lyricwiki.org/api.php') url.setQueryItems([('func', 'getSong'), ('artist', artist), - ('song', self.song.title()), ('fmt', 'xml')]) + ('song', self.song['title']), ('fmt', 'xml')]) self.rep = self.nam.get(QtNetwork.QNetworkRequest(url)) self.rep.finished.connect(self.__handle_search_res) @@ -215,7 +215,7 @@ class Lyrics(Plugin): def fetch(self, song): url = QtCore.QUrl('http://www.animelyrics.com/search.php') - url.setQueryItems([('t', 'performer'), ('q', song.artist())]) + url.setQueryItems([('t', 'performer'), ('q', song['artist'])]) self.fetch2(song, url) self.rep.finished.connect(self.__handle_search_res) @@ -229,7 +229,7 @@ class Lyrics(Plugin): url = None for elem in tree.iterfind('.//a'): - if ('href' in elem.attrib) and elem.text and (self.song.title() in elem.text): + if ('href' in elem.attrib) and elem.text and (self.song['title'] in elem.text): url = QtCore.QUrl('http://www.animelyrics.com/%s'%elem.get('href')) if not url: |