diff --git a/SearchAMG.py b/SearchAMG.py index 0519e08..d387616 100644 --- a/SearchAMG.py +++ b/SearchAMG.py @@ -1,44 +1,44 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search AMG" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search AMG" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action -from picard.ui.itemviews import BaseAction, register_file_action -from picard.metadata import register_track_metadata_processor - -class SearchAMGR(BaseAction): - NAME = "Search AMG for Release" - def callback(self, objs): - cluster = objs[0] - url = "http://wc10.allmusic.com/cg/amg.dll?P=amg&opt1=2&sql=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAMGR()) -register_album_action(SearchAMGR()) - -class SearchAMGA(BaseAction): - NAME = "Search AMG for Artist" - def callback(self, objs): - cluster = objs[0] - url = "http://wc09.allmusic.com/cg/amg.dll?P=amg&opt1=1&sql=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - webbrowser2.open(url) -register_cluster_action(SearchAMGA()) -register_album_action(SearchAMGA()) - -class SearchAMGT(BaseAction): - NAME = "Search AMG for Track" - def callback(self, objs): - file = objs[0] - url = "http://wc10.allmusic.com/cg/amg.dll?P=amg&opt1=3&sql=" - url += QtCore.QUrl.toPercentEncoding(file.metadata["title"]) - webbrowser2.open(url) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search AMG" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search AMG" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action +from picard.ui.itemviews import BaseAction, register_file_action +from picard.metadata import register_track_metadata_processor + +class SearchAMGR(BaseAction): + NAME = "Search AMG for Release" + def callback(self, objs): + cluster = objs[0] + url = "http://wc10.allmusic.com/cg/amg.dll?P=amg&opt1=2&sql=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAMGR()) +register_album_action(SearchAMGR()) + +class SearchAMGA(BaseAction): + NAME = "Search AMG for Artist" + def callback(self, objs): + cluster = objs[0] + url = "http://wc09.allmusic.com/cg/amg.dll?P=amg&opt1=1&sql=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + webbrowser2.open(url) +register_cluster_action(SearchAMGA()) +register_album_action(SearchAMGA()) + +class SearchAMGT(BaseAction): + NAME = "Search AMG for Track" + def callback(self, objs): + file = objs[0] + url = "http://wc10.allmusic.com/cg/amg.dll?P=amg&opt1=3&sql=" + url += QtCore.QUrl.toPercentEncoding(file.metadata["title"]) + webbrowser2.open(url) register_file_action(SearchAMGT()) diff --git a/SearchAmazon3.py b/SearchAmazon3.py index f311a99..78ca242 100644 --- a/SearchAmazon3.py +++ b/SearchAmazon3.py @@ -1,86 +1,86 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search Amazon for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search Amazon" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_album_action -from picard.ui.itemviews import BaseAction, register_cluster_action - -class SearchAmazonCA(BaseAction): - NAME = "Search Amazon.ca" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.ca/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonCA()) -register_album_action(SearchAmazonCA()) - -class SearchAmazonCOM(BaseAction): - NAME = "Search Amazon.com" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.com/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonCOM()) -register_album_action(SearchAmazonCOM()) - -class SearchAmazonDE(BaseAction): - NAME = "Search Amazon.de" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.de/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonDE()) -register_album_action(SearchAmazonDE()) - -class SearchAmazonFR(BaseAction): - NAME = "Search Amazon.fr" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.fr/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonFR()) -register_album_action(SearchAmazonFR()) - -class SearchAmazonJP(BaseAction): - NAME = "Search Amazon.jp" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.jp/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonJP()) -register_album_action(SearchAmazonJP()) - -class SearchAmazonUK(BaseAction): - NAME = "Search Amazon.co.uk" - def callback(self, objs): - cluster = objs[0] - url = "http://www.amazon.co.uk/s/?url=search-alias%3Dpopular&field-keywords=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += " " - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchAmazonUK()) -register_album_action(SearchAmazonUK()) - +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search Amazon for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search Amazon" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_album_action +from picard.ui.itemviews import BaseAction, register_cluster_action + +class SearchAmazonCA(BaseAction): + NAME = "Search Amazon.ca" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.ca/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonCA()) +register_album_action(SearchAmazonCA()) + +class SearchAmazonCOM(BaseAction): + NAME = "Search Amazon.com" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.com/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonCOM()) +register_album_action(SearchAmazonCOM()) + +class SearchAmazonDE(BaseAction): + NAME = "Search Amazon.de" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.de/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonDE()) +register_album_action(SearchAmazonDE()) + +class SearchAmazonFR(BaseAction): + NAME = "Search Amazon.fr" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.fr/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonFR()) +register_album_action(SearchAmazonFR()) + +class SearchAmazonJP(BaseAction): + NAME = "Search Amazon.jp" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.jp/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonJP()) +register_album_action(SearchAmazonJP()) + +class SearchAmazonUK(BaseAction): + NAME = "Search Amazon.co.uk" + def callback(self, objs): + cluster = objs[0] + url = "http://www.amazon.co.uk/s/?url=search-alias%3Dpopular&field-keywords=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += " " + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchAmazonUK()) +register_album_action(SearchAmazonUK()) + diff --git a/SearchCastAlbums3.py b/SearchCastAlbums3.py index b988319..fc57b11 100644 --- a/SearchCastAlbums3.py +++ b/SearchCastAlbums3.py @@ -1,24 +1,24 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search CastAlbums.org for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search CastAlbums.org" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_album_action -from picard.ui.itemviews import BaseAction, register_cluster_action - - -class SearchCastAlbums(BaseAction): - NAME = "Search with CastAlbums.org" - def callback(self, objs): - cluster = objs[0] - url = "http://www.castalbums.org/shows/search/" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchCastAlbums()) -register_album_action(SearchCastAlbums()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search CastAlbums.org for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search CastAlbums.org" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_album_action +from picard.ui.itemviews import BaseAction, register_cluster_action + + +class SearchCastAlbums(BaseAction): + NAME = "Search with CastAlbums.org" + def callback(self, objs): + cluster = objs[0] + url = "http://www.castalbums.org/shows/search/" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchCastAlbums()) +register_album_action(SearchCastAlbums()) diff --git a/SearchDiscogs3.py b/SearchDiscogs3.py index 57f7115..b8217bc 100644 --- a/SearchDiscogs3.py +++ b/SearchDiscogs3.py @@ -1,26 +1,26 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search Discogs for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search Discogs" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - -class SearchDiscogs(BaseAction): - NAME = "Search Discogs" - def callback(self, objs): - cluster = objs[0] - url = "http://www.discogs.com/search?type=all&q=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) - url += "+" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - url += "&btn=Search" - webbrowser2.open(url) -register_cluster_action(SearchDiscogs()) -register_album_action(SearchDiscogs()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search Discogs for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search Discogs" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + +class SearchDiscogs(BaseAction): + NAME = "Search Discogs" + def callback(self, objs): + cluster = objs[0] + url = "http://www.discogs.com/search?type=all&q=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["artist"]) + url += "+" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + url += "&btn=Search" + webbrowser2.open(url) +register_cluster_action(SearchDiscogs()) +register_album_action(SearchDiscogs()) diff --git a/SearchFilmMusziek3.py b/SearchFilmMusziek3.py index ae7552c..698ba05 100644 --- a/SearchFilmMusziek3.py +++ b/SearchFilmMusziek3.py @@ -1,24 +1,24 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search FilmMuziek.be for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search FilmMuziek.be" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - - -class SearchFilmMusic(BaseAction): - NAME = "Search with FilmMuziek.be" - def callback(self, objs): - cluster = objs[0] - url = "http://www.filmmuziek.be/search.cgi?Match=0&Realm=All&Terms=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchFilmMusic()) -register_album_action(SearchFilmMusic()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search FilmMuziek.be for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search FilmMuziek.be" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + + +class SearchFilmMusic(BaseAction): + NAME = "Search with FilmMuziek.be" + def callback(self, objs): + cluster = objs[0] + url = "http://www.filmmuziek.be/search.cgi?Match=0&Realm=All&Terms=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchFilmMusic()) +register_album_action(SearchFilmMusic()) diff --git a/SearchGMR.py b/SearchGMR.py index 216d984..f1b56ea 100644 --- a/SearchGMR.py +++ b/SearchGMR.py @@ -1,23 +1,23 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search Game Music Revolution (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search Game Music Revolution" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - -class SearchGameMusicRevolution(BaseAction): - NAME = "Search with Game Music Revolution" - def callback(self, objs): - cluster = objs[0] - url = "http://www.gmronline.com/results.asp?display=0&go=Go+Find+It&searchType=Title&browseType=Title&results=25&search=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchGameMusicRevolution()) -register_album_action(SearchGameMusicRevolution()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search Game Music Revolution (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search Game Music Revolution" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + +class SearchGameMusicRevolution(BaseAction): + NAME = "Search with Game Music Revolution" + def callback(self, objs): + cluster = objs[0] + url = "http://www.gmronline.com/results.asp?display=0&go=Go+Find+It&searchType=Title&browseType=Title&results=25&search=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchGameMusicRevolution()) +register_album_action(SearchGameMusicRevolution()) diff --git a/SearchGoogle3.py b/SearchGoogle3.py index 44cdb6c..0c8fb0f 100644 --- a/SearchGoogle3.py +++ b/SearchGoogle3.py @@ -4,7 +4,7 @@ PLUGIN_NAME = u"Search with Google for Release (codebase 4.1)" PLUGIN_AUTHOR = u"Brian Schweitzer" PLUGIN_DESCRIPTION = "Search Google. Thanks to Lukas Lalinsky for bug-fix!" PLUGIN_VERSION = "0.1.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] from PyQt4 import QtCore from picard.util import webbrowser2 diff --git a/SearchLortelArchives3.py b/SearchLortelArchives3.py index b345578..cde83a9 100644 --- a/SearchLortelArchives3.py +++ b/SearchLortelArchives3.py @@ -1,25 +1,25 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search the Lortel Archives for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search the Lortel Archives" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - - -class SearchLortelArchives(BaseAction): - NAME = "Search the Lortel Archives" - def callback(self, objs): - cluster = objs[0] - url = "http://www.lortel.org/LLA_archive/index.cfm?keyword=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - url += "&COMMITT=YES&search_by=ALL&Go.x=0&Go.y=0" - webbrowser2.open(url) -register_cluster_action(SearchLortelArchives()) -register_album_action(SearchLortelArchives()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search the Lortel Archives for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search the Lortel Archives" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + + +class SearchLortelArchives(BaseAction): + NAME = "Search the Lortel Archives" + def callback(self, objs): + cluster = objs[0] + url = "http://www.lortel.org/LLA_archive/index.cfm?keyword=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + url += "&COMMITT=YES&search_by=ALL&Go.x=0&Go.y=0" + webbrowser2.open(url) +register_cluster_action(SearchLortelArchives()) +register_album_action(SearchLortelArchives()) diff --git a/SearchSoundtrackCollector3.py b/SearchSoundtrackCollector3.py index 3ff8ca0..bf1cbb8 100644 --- a/SearchSoundtrackCollector3.py +++ b/SearchSoundtrackCollector3.py @@ -1,24 +1,24 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search SoundtrackCollector for Release (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search SoundtrackCollector" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - - -class SearchSoundtrackCollector(BaseAction): - NAME = "Search with SoundtrackCollector" - def callback(self, objs): - cluster = objs[0] - url = "http://www.soundtrackcollector.com/catalog/search.php?searchon=all&searchtext=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchSoundtrackCollector()) -register_album_action(SearchSoundtrackCollector()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search SoundtrackCollector for Release (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search SoundtrackCollector" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + + +class SearchSoundtrackCollector(BaseAction): + NAME = "Search with SoundtrackCollector" + def callback(self, objs): + cluster = objs[0] + url = "http://www.soundtrackcollector.com/catalog/search.php?searchon=all&searchtext=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchSoundtrackCollector()) +register_album_action(SearchSoundtrackCollector()) diff --git a/SearchSoundtrackINFO3.py b/SearchSoundtrackINFO3.py index 028deb8..1312189 100644 --- a/SearchSoundtrackINFO3.py +++ b/SearchSoundtrackINFO3.py @@ -1,23 +1,23 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u"Search SoundtrackINFO (codebase 4.1)" -PLUGIN_AUTHOR = u"Brian Schweitzer" -PLUGIN_DESCRIPTION = "Search SoundtrackINFO" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtCore -from picard.cluster import Cluster -from picard.util import webbrowser2 -from picard.ui.itemviews import BaseAction, register_cluster_action -from picard.ui.itemviews import BaseAction, register_album_action - -class SearchSoundtrackINFO(BaseAction): - NAME = "Search with SoundtrackINFO" - def callback(self, objs): - cluster = objs[0] - url = "http://www.soundtrackinfo.com/search.asp?q=" - url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) - webbrowser2.open(url) -register_cluster_action(SearchSoundtrackINFO()) -register_album_action(SearchSoundtrackINFO()) +# -*- coding: utf-8 -*- + +PLUGIN_NAME = u"Search SoundtrackINFO (codebase 4.1)" +PLUGIN_AUTHOR = u"Brian Schweitzer" +PLUGIN_DESCRIPTION = "Search SoundtrackINFO" +PLUGIN_VERSION = "0.1" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15"] + +from PyQt4 import QtCore +from picard.cluster import Cluster +from picard.util import webbrowser2 +from picard.ui.itemviews import BaseAction, register_cluster_action +from picard.ui.itemviews import BaseAction, register_album_action + +class SearchSoundtrackINFO(BaseAction): + NAME = "Search with SoundtrackINFO" + def callback(self, objs): + cluster = objs[0] + url = "http://www.soundtrackinfo.com/search.asp?q=" + url += QtCore.QUrl.toPercentEncoding(cluster.metadata["album"]) + webbrowser2.open(url) +register_cluster_action(SearchSoundtrackINFO()) +register_album_action(SearchSoundtrackINFO()) diff --git a/__init__.py b/__init__.py deleted file mode 100644 index 4628763..0000000 --- a/__init__.py +++ /dev/null @@ -1,157 +0,0 @@ -# -*- coding: utf-8 -*- - -PLUGIN_NAME = u'Last.fm' -PLUGIN_AUTHOR = u'Lukáš Lalinský' -PLUGIN_DESCRIPTION = u'Use tags from Last.fm as genre.' -PLUGIN_VERSION = "0.2" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] - -from PyQt4 import QtGui, QtCore -from picard.metadata import register_album_metadata_processor, register_track_metadata_processor -from picard.ui.options import register_options_page, OptionsPage -from picard.config import BoolOption, IntOption, TextOption -from picard.plugins.lastfm.ui_options_lastfm import Ui_LastfmOptionsPage -from picard.util import partial - -_cache = {} -# TODO: move this to an options page -TRANSLATE_TAGS = { - "hip hop": u"Hip-Hop", - "synth-pop": u"Synthpop", - "electronica": u"Electronic", -} -TITLE_CASE = True - - -def _tags_finalize(album, metadata, tags, next): - if next: - album._requests += 1 - next(tags) - else: - tags = list(set(tags)) - if tags: - join_tags = album.tagger.config.setting["lastfm_join_tags"] - if join_tags: - tags = join_tags.join(tags) - metadata["genre"] = tags - - -def _tags_downloaded(album, metadata, min_usage, ignore, next, current, data, http, error): - try: - try: intags = data.toptags[0].tag - except AttributeError: intags = [] - tags = [] - for tag in intags: - name = tag.name[0].text.strip() - try: count = int(tag.count[0].text.strip(), 10) - except ValueError: count = 0 - if count < min_usage: - break - try: name = TRANSLATE_TAGS[name] - except KeyError: pass - if name.lower() not in ignore: - tags.append(name.title()) - _cache[str(http.currentRequest().path())] = tags - _tags_finalize(album, metadata, current + tags, next) - finally: - album._requests -= 1 - album._finalize_loading(None) - - -def get_tags(album, metadata, path, min_usage, ignore, next, current): - """Get tags from an URL.""" - try: - if path in _cache: - _tags_finalize(album, metadata, current + _cache[path], next) - else: - album._requests += 1 - album.tagger.xmlws.get("ws.audioscrobbler.com", 80, path, - partial(_tags_downloaded, album, metadata, min_usage, ignore, next, current), - position=1) - finally: - album._requests -= 1 - album._finalize_loading(None) - return False - - -def encode_str(s): - # Yes, that's right, Last.fm prefers double URL-encoding - s = QtCore.QUrl.toPercentEncoding(s) - s = QtCore.QUrl.toPercentEncoding(unicode(s)) - return s - -def get_track_tags(album, metadata, artist, track, min_usage, ignore, next, current): - """Get track top tags.""" - path = "/1.0/track/%s/%s/toptags.xml" % (encode_str(artist), encode_str(track)) - return get_tags(album, metadata, path, min_usage, ignore, next, current) - - -def get_artist_tags(album, metadata, artist, min_usage, ignore, next, current): - """Get artist top tags.""" - path = "/1.0/artist/%s/toptags.xml" % (encode_str(artist),) - return get_tags(album, metadata, path, min_usage, ignore, next, current) - - -def process_track(album, metadata, release, track): - tagger = album.tagger - use_track_tags = tagger.config.setting["lastfm_use_track_tags"] - use_artist_tags = tagger.config.setting["lastfm_use_artist_tags"] - min_tag_usage = tagger.config.setting["lastfm_min_tag_usage"] - ignore_tags = tagger.config.setting["lastfm_ignore_tags"].lower().split(",") - if use_track_tags or use_artist_tags: - artist = metadata["artist"] - title = metadata["title"] - if artist: - if use_artist_tags: - get_artist_tags_func = partial(get_artist_tags, album, metadata, artist, min_tag_usage, ignore_tags, None) - else: - get_artist_tags_func = None - if title and use_track_tags: - func = partial(get_track_tags, album, metadata, artist, title, min_tag_usage, ignore_tags, get_artist_tags_func, []) - elif get_artist_tags_func: - func = partial(get_artist_tags_func, []) - if func: - album._requests += 1 - tagger.xmlws.add_task(func, position=1) - - -class LastfmOptionsPage(OptionsPage): - - NAME = "lastfm" - TITLE = "Last.fm" - PARENT = "plugins" - - options = [ - BoolOption("setting", "lastfm_use_track_tags", False), - BoolOption("setting", "lastfm_use_artist_tags", False), - #BoolOption("setting", "lastfm_use_artist_images", False), - IntOption("setting", "lastfm_min_tag_usage", 15), - TextOption("setting", "lastfm_ignore_tags", "seen live,favorites"), - TextOption("setting", "lastfm_join_tags", ""), - ] - - def __init__(self, parent=None): - super(LastfmOptionsPage, self).__init__(parent) - self.ui = Ui_LastfmOptionsPage() - self.ui.setupUi(self) - - def load(self): - self.ui.use_track_tags.setChecked(self.config.setting["lastfm_use_track_tags"]) - self.ui.use_artist_tags.setChecked(self.config.setting["lastfm_use_artist_tags"]) - #self.ui.use_artist_images.setChecked(self.config.setting["lastfm_use_artist_images"]) - self.ui.min_tag_usage.setValue(self.config.setting["lastfm_min_tag_usage"]) - self.ui.ignore_tags.setText(self.config.setting["lastfm_ignore_tags"]) - self.ui.join_tags.setEditText(self.config.setting["lastfm_join_tags"]) - - def save(self): - self.config.setting["lastfm_use_track_tags"] = self.ui.use_track_tags.isChecked() - self.config.setting["lastfm_use_artist_tags"] = self.ui.use_artist_tags.isChecked() - #self.config.setting["lastfm_use_artist_images"] = self.ui.use_artist_images.isChecked() - self.config.setting["lastfm_min_tag_usage"] = self.ui.min_tag_usage.value() - self.config.setting["lastfm_ignore_tags"] = unicode(self.ui.ignore_tags.text()) - self.config.setting["lastfm_join_tags"] = unicode(self.ui.join_tags.currentText()) - - -register_track_metadata_processor(process_track) -#register_album_metadata_processor(process_album) -register_options_page(LastfmOptionsPage) diff --git a/addrelease.py b/addrelease.py index 38b6b11..4ac21bc 100644 --- a/addrelease.py +++ b/addrelease.py @@ -1,17 +1,34 @@ # -*- coding: utf-8 -*- PLUGIN_NAME = u"Add Cluster As Release" -PLUGIN_AUTHOR = u"Lukáš Lalinský" +PLUGIN_AUTHOR = u"Lukáš Lalinský, Philip Jägenstedt" PLUGIN_DESCRIPTION = "" -PLUGIN_VERSION = "0.1" -PLUGIN_API_VERSIONS = ["0.9.0", "0.10"] +PLUGIN_VERSION = "0.2" +PLUGIN_API_VERSIONS = ["0.9.0", "0.10", "0.15.0"] - -from PyQt4 import QtCore from picard.cluster import Cluster -from picard.util import webbrowser2, format_time +from picard.util import webbrowser2 from picard.ui.itemviews import BaseAction, register_cluster_action +import codecs +import os +import tempfile + +HTML_HEAD = """ + +