using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Plugin.SRFPlay.Api.Models;
namespace Jellyfin.Plugin.SRFPlay.Services.Interfaces;
///
/// Interface for managing topic/category data and filtering.
///
public interface ICategoryService
{
///
/// Gets all topics for a business unit.
///
/// The business unit.
/// The cancellation token.
/// List of topics.
Task> GetTopicsAsync(string businessUnit, CancellationToken cancellationToken = default);
///
/// Gets a topic by ID.
///
/// The topic ID.
/// The business unit.
/// The cancellation token.
/// The topic, or null if not found.
Task GetTopicByIdAsync(string topicId, string businessUnit, CancellationToken cancellationToken = default);
///
/// Filters shows by topic ID.
///
/// The shows to filter.
/// The topic ID to filter by.
/// Filtered list of shows.
IReadOnlyList FilterShowsByTopic(IReadOnlyList shows, string topicId);
///
/// Groups shows by their topics.
///
/// The shows to group.
/// Dictionary mapping topic IDs to shows.
IReadOnlyDictionary> GroupShowsByTopics(IReadOnlyList shows);
///
/// Gets shows for a specific topic, sorted by number of episodes.
///
/// The topic ID.
/// The business unit.
/// Maximum number of results to return.
/// The cancellation token.
/// List of shows for the topic.
Task> GetShowsByTopicAsync(
string topicId,
string businessUnit,
int maxResults = 50,
CancellationToken cancellationToken = default);
///
/// Gets video count for each topic.
///
/// The shows to analyze.
/// Dictionary mapping topic IDs to video counts.
IReadOnlyDictionary GetVideoCountByTopic(IReadOnlyList shows);
///
/// Clears the topics cache.
///
void ClearCache();
}