diff --git a/maloja/__pkginfo__.py b/maloja/__pkginfo__.py index e7a9a8b..254b883 100644 --- a/maloja/__pkginfo__.py +++ b/maloja/__pkginfo__.py @@ -5,7 +5,7 @@ author = { "email":"maloja@krateng.dev", "github": "krateng" } -version = 2,6,2 +version = 2,6,3 versionstr = ".".join(str(n) for n in version) links = { "pypi":"malojaserver", diff --git a/maloja/thirdparty/__init__.py b/maloja/thirdparty/__init__.py index 18738e4..055c48e 100644 --- a/maloja/thirdparty/__init__.py +++ b/maloja/thirdparty/__init__.py @@ -15,15 +15,12 @@ from doreah.logging import log - services = { "proxyscrobble":[], "import":[], "metadata":[] } -metadata_service_ids = {} - def proxy_scrobble_all(artists,title,timestamp): for service in services["proxyscrobble"]: @@ -79,7 +76,7 @@ class GenericInterface: services["import"].append(s) log(cls.name + " registered as scrobble import source") if s.active_metadata(): - metadata_service_ids[s.identifier] = s + services["metadata"].append(s) log(cls.name + " registered as metadata provider") def authorize(self): @@ -135,7 +132,7 @@ class MetadataInterface(GenericInterface,abstract=True): def active_metadata(self): return ( all(self.settings[key] not in [None,"ASK"] for key in self.metadata["required_settings"]) and - get_settings(self.metadata["activated_setting"]) + self.identifier in get_settings("METADATA_PROVIDERS") ) def get_image_track(self,track): @@ -205,9 +202,6 @@ __all__ = [ from . import * - -services["metadata"] = [ - metadata_service_ids[pr] - for pr in get_settings("METADATA_PROVIDERS") - if metadata_service_ids[pr].active_metadata() -] +services["metadata"].sort( + key=lambda provider : get_settings("METADATA_PROVIDERS").index(provider.identifier) +)