diff options
Diffstat (limited to 'Emby.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/LibraryManager.cs | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 6ffe67776..58a971f62 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1389,6 +1389,25 @@ namespace Emby.Server.Implementations.Library return _itemRepository.GetCount(query); } + public ItemCounts GetItemCounts(InternalItemsQuery query) + { + if (query.Recursive && !query.ParentId.IsEmpty()) + { + var parent = GetItemById(query.ParentId); + if (parent is not null) + { + SetTopParentIdsOrAncestors(query, [parent]); + } + } + + if (query.User is not null) + { + AddUserToQuery(query, query.User); + } + + return _itemRepository.GetItemCounts(query); + } + public IReadOnlyList<BaseItem> GetItemList(InternalItemsQuery query, List<BaseItem> parents) { SetTopParentIdsOrAncestors(query, parents); @@ -1954,7 +1973,7 @@ namespace Emby.Server.Implementations.Library try { - return _fileSystem.GetLastWriteTimeUtc(image.Path) != image.DateModified; + return image.DateModified.Subtract(_fileSystem.GetLastWriteTimeUtc(image.Path)).Duration().TotalSeconds > 1; } catch (Exception ex) { @@ -2025,7 +2044,8 @@ namespace Emby.Server.Implementations.Library try { - image.BlurHash = _imageProcessor.GetImageBlurHash(image.Path, size); + var blurhash = _imageProcessor.GetImageBlurHash(image.Path, size); + image.BlurHash = blurhash; } catch (Exception ex) { @@ -2035,7 +2055,8 @@ namespace Emby.Server.Implementations.Library try { - image.DateModified = _fileSystem.GetLastWriteTimeUtc(image.Path); + var modifiedDate = _fileSystem.GetLastWriteTimeUtc(image.Path); + image.DateModified = modifiedDate; } catch (Exception ex) { @@ -2044,6 +2065,7 @@ namespace Emby.Server.Implementations.Library } _itemRepository.SaveImages(item); + RegisterItem(item); } @@ -3047,6 +3069,8 @@ namespace Emby.Server.Implementations.Library } await RunMetadataSavers(personEntity, itemUpdateType).ConfigureAwait(false); + personEntity.DateLastSaved = DateTime.UtcNow; + CreateItems([personEntity], null, CancellationToken.None); } } |
