fix: creation of lyrics
This commit is contained in:
parent
4cbbee26e4
commit
2dff8e4e0e
@ -18,23 +18,11 @@ class Lyrics(OuterProxy):
|
||||
text: FormattedText
|
||||
language: Language
|
||||
|
||||
source_collection: SourceCollection
|
||||
|
||||
_default_factories = {
|
||||
"text": FormattedText,
|
||||
"language": Language.by_alpha_2("en"),
|
||||
"language": lambda: Language.by_alpha_2("en"),
|
||||
|
||||
"source_collection": SourceCollection,
|
||||
}
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
text: FormattedText,
|
||||
language: pycountry.Languages = pycountry.languages.get(alpha_2="en"),
|
||||
_id: str = None,
|
||||
dynamic: bool = False,
|
||||
source_list: List[Source] = None,
|
||||
**kwargs
|
||||
) -> None:
|
||||
super().__init__(_id=_id, dynamic=dynamic, **kwargs)
|
||||
|
||||
self.text: FormattedText = text or FormattedText()
|
||||
self.language: pycountry.Languages = language
|
||||
|
||||
self.source_collection: SourceCollection = SourceCollection(source_list)
|
||||
|
@ -290,9 +290,7 @@ class Album(Base):
|
||||
|
||||
@property
|
||||
def options(self) -> List[P]:
|
||||
options = self.artist_collection.shallow_list
|
||||
options.append(self)
|
||||
options.extend(self.song_collection)
|
||||
options = [*self.artist_collection, self, *self.song_collection]
|
||||
|
||||
return options
|
||||
|
||||
|
@ -306,9 +306,7 @@ class Bandcamp(Page):
|
||||
track_lyrics = soup.find("div", {"class": "lyricsText"})
|
||||
if track_lyrics:
|
||||
self.LOGGER.debug(" Lyrics retrieved..")
|
||||
return [Lyrics(FormattedText(
|
||||
html=track_lyrics.prettify()
|
||||
), pycountry.languages.get(alpha_2="en"))]
|
||||
return [Lyrics(text=FormattedText(html=track_lyrics.prettify()))]
|
||||
|
||||
return []
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user