API: Update Thumb/ThumbSrc for subjects and labels #4151

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-10-03 23:17:07 +02:00
parent 241f1df4c4
commit d7ee54ec58
9 changed files with 317 additions and 4 deletions

View File

@@ -75,6 +75,21 @@ func RemoveFromAlbumCoverCache(uid string) {
}
}
// RemoveFromLabelCoverCache removes covers by label UID e.g. after updates.
func RemoveFromLabelCoverCache(uid string) {
if !rnd.IsAlnum(uid) {
return
}
cache := get.CoverCache()
for thumbName := range thumb.Sizes {
cacheKey := CacheKey(labelCover, uid, string(thumbName))
cache.Delete(cacheKey)
log.Debugf("removed %s from cache", cacheKey)
}
}
// FlushCoverCache clears the complete cover cache.
func FlushCoverCache() {
get.CoverCache().Flush()