mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
API: Update Thumb/ThumbSrc for subjects and labels #4151
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user