aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Persistence
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Persistence')
-rw-r--r--MediaBrowser.Controller/Persistence/IItemCountService.cs16
-rw-r--r--MediaBrowser.Controller/Persistence/IItemRepository.cs7
-rw-r--r--MediaBrowser.Controller/Persistence/IPeopleRepository.cs6
3 files changed, 27 insertions, 2 deletions
diff --git a/MediaBrowser.Controller/Persistence/IItemCountService.cs b/MediaBrowser.Controller/Persistence/IItemCountService.cs
index d57f1fc893..14c422cb60 100644
--- a/MediaBrowser.Controller/Persistence/IItemCountService.cs
+++ b/MediaBrowser.Controller/Persistence/IItemCountService.cs
@@ -37,6 +37,18 @@ public interface IItemCountService
ItemCounts GetItemCountsForNameItem(BaseItemKind kind, Guid id, BaseItemKind[] relatedItemKinds, InternalItemsQuery accessFilter);
/// <summary>
+ /// Gets item counts for several "by-name" items of the same kind. Kinds keyed by a cleaned
+ /// item value - artists, genres and studios - are answered in one set of queries for the whole
+ /// batch; the rest fall back to one query per id.
+ /// </summary>
+ /// <param name="kind">The kind of the name items.</param>
+ /// <param name="ids">The IDs of the name items.</param>
+ /// <param name="relatedItemKinds">The item kinds to count.</param>
+ /// <param name="accessFilter">A pre-configured query with user access filtering settings.</param>
+ /// <returns>The item counts of each requested id.</returns>
+ Dictionary<Guid, ItemCounts> GetItemCountsForNameItems(BaseItemKind kind, IReadOnlyList<Guid> ids, BaseItemKind[] relatedItemKinds, InternalItemsQuery accessFilter);
+
+ /// <summary>
/// Gets the count of played items that are descendants of the specified ancestor.
/// </summary>
/// <param name="filter">The query filter containing user access settings.</param>
@@ -80,7 +92,7 @@ public interface IItemCountService
/// Batch-fetches child counts for multiple parent folders.
/// </summary>
/// <param name="parentIds">The list of parent folder IDs.</param>
- /// <param name="userId">The user ID for access filtering.</param>
+ /// <param name="user">The user the counts are for, or null to count without a user's preferences.</param>
/// <returns>Dictionary mapping parent ID to child count.</returns>
- Dictionary<Guid, int> GetChildCountBatch(IReadOnlyList<Guid> parentIds, Guid? userId);
+ Dictionary<Guid, int> GetChildCountBatch(IReadOnlyList<Guid> parentIds, User? user);
}
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index d44fe57bed..3cf06b897c 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -129,6 +129,13 @@ public interface IItemRepository
public IReadOnlyList<string> GetMediaStreamLanguages(InternalItemsQuery filter, MediaStreamType mediaStreamType);
/// <summary>
+ /// Gets all distinct tags of the matching base items.
+ /// </summary>
+ /// <param name="filter">The query filter.</param>
+ /// <returns>The list of tags.</returns>
+ IReadOnlyList<string> GetTagNames(InternalItemsQuery filter);
+
+ /// <summary>
/// Gets all artist names.
/// </summary>
/// <returns>The list of artist names.</returns>
diff --git a/MediaBrowser.Controller/Persistence/IPeopleRepository.cs b/MediaBrowser.Controller/Persistence/IPeopleRepository.cs
index 9811241d31..15183a8806 100644
--- a/MediaBrowser.Controller/Persistence/IPeopleRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IPeopleRepository.cs
@@ -34,6 +34,12 @@ public interface IPeopleRepository
IReadOnlyList<string> GetPeopleNames(InternalPeopleQuery filter);
/// <summary>
+ /// Deletes every credit that no item maps to any more.
+ /// </summary>
+ /// <returns>The number of credits that were deleted.</returns>
+ int DeleteOrphanedCredits();
+
+ /// <summary>
/// Gets the distinct people names per item for multiple items efficiently by querying from the mapping table.
/// </summary>
/// <param name="itemIds">The item IDs to get people for.</param>