IPlaylistManager.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Entities;
  6. using MediaBrowser.Model.Playlists;
  7. namespace MediaBrowser.Controller.Playlists
  8. {
  9. public interface IPlaylistManager
  10. {
  11. /// <summary>
  12. /// Gets the playlists.
  13. /// </summary>
  14. /// <param name="userId">The user identifier.</param>
  15. /// <returns>IEnumerable&lt;Playlist&gt;.</returns>
  16. IEnumerable<Playlist> GetPlaylists(Guid userId);
  17. /// <summary>
  18. /// Creates the playlist.
  19. /// </summary>
  20. /// <param name="options">The options.</param>
  21. /// <returns>Task&lt;Playlist&gt;.</returns>
  22. Task<PlaylistCreationResult> CreatePlaylist(PlaylistCreationRequest options);
  23. /// <summary>
  24. /// Adds to playlist.
  25. /// </summary>
  26. /// <param name="playlistId">The playlist identifier.</param>
  27. /// <param name="itemIds">The item ids.</param>
  28. /// <param name="userId">The user identifier.</param>
  29. /// <returns>Task.</returns>
  30. Task AddToPlaylistAsync(Guid playlistId, IReadOnlyCollection<Guid> itemIds, Guid userId);
  31. /// <summary>
  32. /// Removes from playlist.
  33. /// </summary>
  34. /// <param name="playlistId">The playlist identifier.</param>
  35. /// <param name="entryIds">The entry ids.</param>
  36. /// <returns>Task.</returns>
  37. Task RemoveFromPlaylistAsync(string playlistId, IEnumerable<string> entryIds);
  38. /// <summary>
  39. /// Gets the playlists folder.
  40. /// </summary>
  41. /// <returns>Folder.</returns>
  42. Folder GetPlaylistsFolder();
  43. /// <summary>
  44. /// Gets the playlists folder for a user.
  45. /// </summary>
  46. /// <param name="userId">The user identifier.</param>
  47. /// <returns>Folder.</returns>
  48. Folder GetPlaylistsFolder(Guid userId);
  49. /// <summary>
  50. /// Moves the item.
  51. /// </summary>
  52. /// <param name="playlistId">The playlist identifier.</param>
  53. /// <param name="entryId">The entry identifier.</param>
  54. /// <param name="newIndex">The new index.</param>
  55. /// <returns>Task.</returns>
  56. Task MoveItemAsync(string playlistId, string entryId, int newIndex);
  57. /// <summary>
  58. /// Removed all playlists of a user.
  59. /// If the playlist is shared, ownership is transferred.
  60. /// </summary>
  61. /// <param name="userId">The user id.</param>
  62. /// <returns>Task.</returns>
  63. Task RemovePlaylistsAsync(Guid userId);
  64. /// <summary>
  65. /// Saves a playlist.
  66. /// </summary>
  67. /// <param name="item">The playlist.</param>
  68. void SavePlaylistFile(Playlist item);
  69. }
  70. }