Initial commit
This commit is contained in:
commit
ee3c2358ff
12 changed files with 622 additions and 0 deletions
20
lyrics_dl/registry.py
Normal file
20
lyrics_dl/registry.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from lyrics_dl.core import AbstractProvider
|
||||
|
||||
|
||||
class Registry:
|
||||
providers: dict[str, type[AbstractProvider]] = {}
|
||||
|
||||
@staticmethod
|
||||
def get_synced_providers() -> dict[str, type[AbstractProvider]]:
|
||||
# TODO: stub
|
||||
return dict(Registry.providers)
|
||||
|
||||
@staticmethod
|
||||
def register_provider(provider_class: type[AbstractProvider]) -> None:
|
||||
Registry.providers[provider_class.name] = provider_class
|
||||
|
||||
|
||||
def lyrics_provider(cls: type[AbstractProvider]) -> type[AbstractProvider]:
|
||||
Registry.register_provider(cls)
|
||||
|
||||
return cls
|
Loading…
Add table
Add a link
Reference in a new issue