IJellyfinDatabaseProvider.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. using Microsoft.EntityFrameworkCore;
  5. namespace Jellyfin.Server.Implementations;
  6. /// <summary>
  7. /// Defines the type and extension points for multi database support.
  8. /// </summary>
  9. public interface IJellyfinDatabaseProvider : IAsyncDisposable
  10. {
  11. /// <summary>
  12. /// Initialises jellyfins EFCore database access.
  13. /// </summary>
  14. /// <param name="options">The EFCore database options.</param>
  15. void Initialise(DbContextOptionsBuilder options);
  16. /// <summary>
  17. /// Will be invoked when EFCore wants to build its model.
  18. /// </summary>
  19. /// <param name="modelBuilder">The ModelBuilder from EFCore.</param>
  20. void OnModelCreating(ModelBuilder modelBuilder);
  21. /// <summary>
  22. /// If supported this should run any periodic maintaince tasks.
  23. /// </summary>
  24. /// <param name="cancellationToken">The token to abort the operation.</param>
  25. /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
  26. Task RunScheduledOptimisation(CancellationToken cancellationToken);
  27. }