diff --git a/starsky/starsky.foundation.readmeta/Services/ReadMeta.cs b/starsky/starsky.foundation.readmeta/Services/ReadMeta.cs index 88797d581..7435ba8df 100644 --- a/starsky/starsky.foundation.readmeta/Services/ReadMeta.cs +++ b/starsky/starsky.foundation.readmeta/Services/ReadMeta.cs @@ -124,7 +124,7 @@ public void UpdateReadMetaCache(IEnumerable objectExifToolModel) { foreach ( var item in objectExifToolModel ) { - UpdateReadMetaCache(item.FilePath!, item); + UpdateReadMetaCacheSingle(item.FilePath!, item); } } @@ -153,6 +153,27 @@ public void UpdateReadMetaCache(IEnumerable objectExifToolModel) return true; } + + /// + /// Update Cache only for ReadMeta! + /// To 15 minutes + /// + /// can also be a subPath + /// the item + private void UpdateReadMetaCacheSingle(string fullFilePath, FileIndexItem objectExifToolModel) + { + if ( _cache == null || _appSettings?.AddMemoryCache == false ) + { + return; + } + + var toUpdateObject = objectExifToolModel.Clone(); + var queryReadMetaCacheName = CachePrefix + fullFilePath; + RemoveReadMetaCache(fullFilePath); + _cache.Set(queryReadMetaCacheName, toUpdateObject, + new TimeSpan(0, 15, 0)); + } + private async Task ReadExifAndXmpFromFileDirectAsync(string subPath) { if ( _iStorage.ExistFile(subPath) @@ -192,25 +213,4 @@ private async Task ReadExifAndXmpFromFileDirectAsync(string subPa FileIndexCompareHelper.Compare(fileExifItemFile, xmpFileIndexItem); return fileExifItemFile; } - - - /// - /// Update Cache only for ReadMeta! - /// To 15 minutes - /// - /// can also be a subPath - /// the item - public void UpdateReadMetaCache(string fullFilePath, FileIndexItem objectExifToolModel) - { - if ( _cache == null || _appSettings?.AddMemoryCache == false ) - { - return; - } - - var toUpdateObject = objectExifToolModel.Clone(); - var queryReadMetaCacheName = CachePrefix + fullFilePath; - RemoveReadMetaCache(fullFilePath); - _cache.Set(queryReadMetaCacheName, toUpdateObject, - new TimeSpan(0, 15, 0)); - } }