IDisplayPreferencesManager.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /// Updates or Creates the display preferences.
  58. /// </summary>
  59. /// <param name="displayPreferences">The entity to update or create.</param>
  60. void UpdateDisplayPreferences(DisplayPreferences displayPreferences);
  61. /// <summary>
  62. /// Updates or Creates the display preferences for the given item.
  63. /// </summary>
  64. /// <param name="itemDisplayPreferences">The entity to update or create.</param>
  65. void UpdateItemDisplayPreferences(ItemDisplayPreferences itemDisplayPreferences);
  66. }
  67. }