more mpris features

This commit is contained in:
Drew Weymouth
2023-07-12 17:41:16 -07:00
parent 2a17718969
commit 61d5ad917d
4 changed files with 60 additions and 13 deletions
+10
View File
@@ -88,6 +88,16 @@ func (i *ImageManager) GetFullSizeCoverArt(coverID string) (image.Image, error)
return im, nil
}
func (i *ImageManager) GetCoverArtUrl(coverID string) (string, error) {
path := i.filePathForCover(coverID)
if _, err := os.Stat(path); err == nil {
// this is probably broken for Windows but it's currently only used
// for MPRIS, so we are OK for now
return fmt.Sprintf("file://%s", path), nil
}
return "", errors.New("cover not found")
}
func (i *ImageManager) GetCachedArtistImage(artistID string) (image.Image, bool) {
return i.loadLocalImage(i.filePathForArtistImage(artistID))
}