Add local agent, only for images

This commit is contained in:
Deluan
2022-12-30 23:52:53 -05:00
committed by Deluan Quintão
parent 387acc5f63
commit bf461473ef
15 changed files with 134 additions and 76 deletions
+18 -1
View File
@@ -112,9 +112,26 @@ func fromFFmpegTag(ctx context.Context, ffmpeg ffmpeg.FFmpeg, path string) sourc
}
}
func fromPlaceholder() sourceFunc {
func fromAlbum(ctx context.Context, a *artwork, id model.ArtworkID) sourceFunc {
return func() (io.ReadCloser, string, error) {
r, _, err := a.Get(ctx, id.String(), 0)
if err != nil {
return nil, "", err
}
return r, id.String(), nil
}
}
func fromAlbumPlaceholder() sourceFunc {
return func() (io.ReadCloser, string, error) {
r, _ := resources.FS().Open(consts.PlaceholderAlbumArt)
return r, consts.PlaceholderAlbumArt, nil
}
}
func fromArtistPlaceholder() sourceFunc {
return func() (io.ReadCloser, string, error) {
r, _ := resources.FS().Open(consts.PlaceholderArtistArt)
return r, consts.PlaceholderArtistArt, nil
}
}