feat(subsonic): add support for lyrics (#519)

* Add songLyrics extension since the getLyricsBySongId method is implemented

* Add support for lyrics

* Add check for getLyrics function

* fix typo

* chore: fix tests

* fix(lyrics): if lrc is formatted with empty spaces remove them

* fix(lint): use NewError correctly

bump ts
This commit is contained in:
./daniele
2025-08-26 11:09:00 +01:00
committed by sentriz
parent 5916a7fe7b
commit db97bc753e
11 changed files with 183 additions and 2 deletions

No files matched your search

+1
View File
@@ -25,6 +25,7 @@ type Info interface {
TrackNumber() int
DiscNumber() int
Year() int
Lyrics() string
Compilation() bool
ReleaseType() string
+3
View File
@@ -51,6 +51,9 @@ func (i *info) Genres() []string { return find(i.raw, "genres") }
func (i *info) TrackNumber() int { return intSep("/", first(find(i.raw, "tracknumber"))) } // eg. 5/12
func (i *info) DiscNumber() int { return intSep("/", first(find(i.raw, "discnumber"))) } // eg. 1/2
func (i *info) Year() int { return intSep("-", first(find(i.raw, "originaldate", "date", "year"))) } // eg. 2023-12-01
func (i *info) Lyrics() string {
return first(find(i.raw, "lyrics", "lyrics:description", "USLT:description", "LYRICS", "Lyrics", "©lyr"))
}
func (i *info) Compilation() bool { return bl(first(find(i.raw, "compilation"))) }
func (i *info) ReleaseType() string { return first(find(i.raw, "releasetype")) }