86883cd5c6
- Refactor migrations and provider to use multiple PostgreSQL schemas, each matching a legacy SQLite database (activitylog, authentication, displaypreferences, library, users). - All tables, foreign keys, and indexes are now schema-qualified; Down migration drops tables by schema. - Provider ensures schemas exist before migrations; entities are mapped to correct schemas in OnModelCreating. - Add support for max-pool-size, min-pool-size, and multiplexing connection options; update logging accordingly. - VACUUM ANALYZE now runs per schema during scheduled optimization. - TruncateAllTablesAsync now truncates tables with schema qualification. - README updated with schema structure, new options, and multiplexing warnings. - CacheDecorator now calls async repository methods using .GetAwaiter().GetResult(), with documentation. - Lays groundwork for full async/await and multiplexing support in the database layer.
52 lines
2.0 KiB
C#
52 lines
2.0 KiB
C#
// <copyright file="IChapterRepository.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace MediaBrowser.Controller.Persistence;
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
/// <summary>
|
|
/// Interface IChapterRepository.
|
|
/// </summary>
|
|
public interface IChapterRepository
|
|
{
|
|
/// <summary>
|
|
/// Deletes the chapters.
|
|
/// </summary>
|
|
/// <param name="itemId">The item.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>Task.</returns>
|
|
Task DeleteChaptersAsync(Guid itemId, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Saves the chapters asynchronously.
|
|
/// </summary>
|
|
/// <param name="itemId">The item.</param>
|
|
/// <param name="chapters">The set of chapters.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>A task representing the asynchronous operation.</returns>
|
|
Task SaveChaptersAsync(Guid itemId, IReadOnlyList<ChapterInfo> chapters, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Gets all chapters associated with the baseItem asynchronously.
|
|
/// </summary>
|
|
/// <param name="baseItemId">The BaseItems id.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>A readonly list of chapter instances.</returns>
|
|
Task<IReadOnlyList<ChapterInfo>> GetChaptersAsync(Guid baseItemId, CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Gets a single chapter of a BaseItem on a specific index asynchronously.
|
|
/// </summary>
|
|
/// <param name="baseItemId">The BaseItems id.</param>
|
|
/// <param name="index">The index of that chapter.</param>
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
/// <returns>A chapter instance.</returns>
|
|
Task<ChapterInfo?> GetChapterAsync(Guid baseItemId, int index, CancellationToken cancellationToken = default);
|
|
}
|