using System;
using System.Collections.Generic;
using Jellyfin.Data.Enums;
using Jellyfin.Database.Implementations.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.Persistence;
///
/// Provides item counting and played-status query operations.
///
public interface IItemCountService
{
///
/// Gets the count of items matching the filter.
///
/// The query filter.
/// The item count.
int GetCount(InternalItemsQuery filter);
///
/// Gets item counts grouped by type.
///
/// The query filter.
/// The item counts by type.
ItemCounts GetItemCounts(InternalItemsQuery filter);
///
/// Gets item counts for a "by-name" item using an optimized query.
///
/// The kind of the name item.
/// The ID of the name item.
/// The item kinds to count.
/// A pre-configured query with user access filtering settings.
/// The item counts grouped by type.
ItemCounts GetItemCountsForNameItem(BaseItemKind kind, Guid id, BaseItemKind[] relatedItemKinds, InternalItemsQuery accessFilter);
///
/// Gets the count of played items that are descendants of the specified ancestor.
///
/// The query filter containing user access settings.
/// The ancestor item id.
/// The count of played descendant items.
int GetPlayedCount(InternalItemsQuery filter, Guid ancestorId);
///
/// Gets the total count of items that are descendants of the specified ancestor.
///
/// The query filter containing user access settings.
/// The ancestor item id.
/// The total count of descendant items.
int GetTotalCount(InternalItemsQuery filter, Guid ancestorId);
///
/// Gets both the played count and total count of descendant items.
///
/// The query filter containing user access settings.
/// The ancestor item id.
/// A tuple containing (Played count, Total count).
(int Played, int Total) GetPlayedAndTotalCount(InternalItemsQuery filter, Guid ancestorId);
///
/// Gets both the played count and total count from linked children.
///
/// The query filter containing user access settings.
/// The parent item id.
/// A tuple containing (Played count, Total count).
(int Played, int Total) GetPlayedAndTotalCountFromLinkedChildren(InternalItemsQuery filter, Guid parentId);
///
/// Batch-fetches played and total counts for multiple folder items.
///
/// The list of folder item IDs to get counts for.
/// The user for access filtering and played status.
/// Dictionary mapping folder ID to (Played count, Total count).
Dictionary GetPlayedAndTotalCountBatch(IReadOnlyList folderIds, User user);
///
/// Batch-fetches child counts for multiple parent folders.
///
/// The list of parent folder IDs.
/// The user ID for access filtering.
/// Dictionary mapping parent ID to child count.
Dictionary GetChildCountBatch(IReadOnlyList parentIds, Guid? userId);
}