IDisplayPreferencesManager.cs 3.0 KB

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