IDisplayPreferencesManager.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using System;
  2. using System.Collections.Generic;
  3. using Jellyfin.Database.Implementations.Entities;
  4. namespace MediaBrowser.Controller
  5. {
  6. /// <summary>
  7. /// Manages the storage and retrieval of display preferences.
  8. /// </summary>
  9. public interface IDisplayPreferencesManager
  10. {
  11. /// <summary>
  12. /// Gets the display preferences for the user and client.
  13. /// </summary>
  14. /// <remarks>
  15. /// This will create the display preferences if it does not exist, but it will not save automatically.
  16. /// </remarks>
  17. /// <param name="userId">The user's id.</param>
  18. /// <param name="itemId">The item id.</param>
  19. /// <param name="client">The client string.</param>
  20. /// <returns>The associated display preferences.</returns>
  21. DisplayPreferences GetDisplayPreferences(Guid userId, Guid itemId, string client);
  22. /// <summary>
  23. /// Gets the default item display preferences for the user and client.
  24. /// </summary>
  25. /// <remarks>
  26. /// This will create the item display preferences if it does not exist, but it will not save automatically.
  27. /// </remarks>
  28. /// <param name="userId">The user id.</param>
  29. /// <param name="itemId">The item id.</param>
  30. /// <param name="client">The client string.</param>
  31. /// <returns>The item display preferences.</returns>
  32. ItemDisplayPreferences GetItemDisplayPreferences(Guid userId, Guid itemId, string client);
  33. /// <summary>
  34. /// Gets all of the item display preferences for the user and client.
  35. /// </summary>
  36. /// <param name="userId">The user id.</param>
  37. /// <param name="client">The client string.</param>
  38. /// <returns>A list of item display preferences.</returns>
  39. IList<ItemDisplayPreferences> ListItemDisplayPreferences(Guid userId, string client);
  40. /// <summary>
  41. /// Gets all of the custom item display preferences for the user and client.
  42. /// </summary>
  43. /// <param name="userId">The user id.</param>
  44. /// <param name="itemId">The item id.</param>
  45. /// <param name="client">The client string.</param>
  46. /// <returns>The dictionary of custom item display preferences.</returns>
  47. Dictionary<string, string?> ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client);
  48. /// <summary>
  49. /// Sets the custom item display preference for the user and client.
  50. /// </summary>
  51. /// <param name="userId">The user id.</param>
  52. /// <param name="itemId">The item id.</param>
  53. /// <param name="client">The client id.</param>
  54. /// <param name="customPreferences">A dictionary of custom item display preferences.</param>
  55. void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary<string, string?> customPreferences);
  56. /// <summary>
  57. /// Saves changes made to the database.
  58. /// </summary>
  59. void SaveChanges();
  60. }
  61. }