music-kraken-core/music_kraken/objects/lyrics.py
Lars Noack bab6aeb45d
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
fix: removed double linebreaks from formated text, plaintext
2024-05-15 14:26:19 +02:00

40 lines
1.0 KiB
Python

from typing import List
from collections import defaultdict
import pycountry
from .parents import OuterProxy
from .source import Source, SourceCollection
from .formatted_text import FormattedText
from .country import Language
from .metadata import (
Mapping as id3Mapping,
ID3Timestamp,
Metadata
)
class Lyrics(OuterProxy):
text: FormattedText
language: Language
source_collection: SourceCollection
_default_factories = {
"text": FormattedText,
"language": lambda: Language.by_alpha_2("en"),
"source_collection": SourceCollection,
}
# This is automatically generated
def __init__(self, text: FormattedText = None, language: Language = None, source_list: SourceCollection = None,
**kwargs) -> None:
super().__init__(text=text, language=language, source_list=source_list, **kwargs)
@property
def metadata(self) -> Metadata:
return Metadata({
id3Mapping.UNSYNCED_LYRICS: [self.text.plaintext]
})