music-kraken-core/src/music_kraken/objects/lyrics.py

30 lines
829 B
Python
Raw Normal View History

2023-02-25 21:16:32 +00:00
from typing import List
import pycountry
from .parents import DatabaseObject
2023-03-10 08:09:35 +00:00
from .source import Source, SourceCollection
from .metadata import Metadata
2023-02-25 21:16:32 +00:00
from .formatted_text import FormattedText
2023-03-10 08:09:35 +00:00
class Lyrics(DatabaseObject):
2023-03-13 13:33:17 +00:00
COLLECTION_ATTRIBUTES = ("source_collection",)
SIMPLE_ATTRIBUTES = ("text", "language")
2023-03-13 13:30:11 +00:00
2023-02-25 21:16:32 +00:00
def __init__(
self,
text: FormattedText,
language: pycountry.Languages,
_id: str = None,
dynamic: bool = False,
source_list: List[Source] = None,
**kwargs
) -> None:
2023-03-10 09:13:35 +00:00
DatabaseObject.__init__(self, _id=_id, dynamic=dynamic)
2023-02-25 21:16:32 +00:00
self.text: FormattedText = text
self.language: pycountry.Languages = language
2023-03-10 08:09:35 +00:00
self.source_collection: SourceCollection = SourceCollection(source_list)