fix: retry failed discover artwork

This commit is contained in:
ShukeBta
2026-06-24 17:24:15 +08:00
parent 55673b1675
commit d93a28f18f
6 changed files with 153 additions and 35 deletions
+14
View File
@@ -38,6 +38,20 @@ func (p *ImageProxy) RemoveCached(raw string) error {
return nil
}
func (p *ImageProxy) RemoveFailed(raw string) error {
if !isHTTPish(raw) {
return nil
}
_, _, failPath, err := p.remoteImageCachePaths(raw)
if err != nil {
return nil
}
if err := os.Remove(failPath); err != nil && !errors.Is(err, os.ErrNotExist) {
return err
}
return nil
}
// Serve writes the requested image to w. Caller is expected to validate
// the JWT before invoking it.
func (p *ImageProxy) Serve(ctx context.Context, w http.ResponseWriter, r *http.Request, raw string) error {