Skip to content

Commit

Permalink
feat(Track.get_metadata): add lyrics tag support
Browse files Browse the repository at this point in the history
also adds prelimitary support for subtitles tag
to add better support for subtitles tagging beetbox/mediafile#48 will need to be resolved

finishes metadata function and resolves #22
  • Loading branch information
JuniorJPDJ committed May 15, 2021
1 parent 77243e8 commit 9f1ba11
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tidal_async/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,6 @@ async def subtitles(self) -> Optional[str]:
return lyrics_dict["subtitles"]

async def get_metadata(self):
# TODO [#22]: Rewrite Track.get_metadata
# - [ ] lyrics
# - [x] rewrite title parsing
# - [x] replayGain
# - [x] multiple artists
# - [x] Tidal track URL
album = self.album
await album.reload_info()

Expand Down Expand Up @@ -271,6 +265,17 @@ async def get_metadata(self):
if "upc" in album and album.upc:
tags["barcode"] = album.upc

lyrics = await self.lyrics()
if lyrics:
tags["lyrics"] = lyrics

subtitles = await self.subtitles()
if subtitles:
# TODO: Support for subtitles tag
# prelimitary invalid support for subtitles tag
# depends on beetbox/mediafile#48
tags["subtitles"] = subtitles

return tags


Expand Down

0 comments on commit 9f1ba11

Please sign in to comment.