2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2018-12-27 23:27:57 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading.Tasks;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
2024-03-26 14:29:48 +00:00
|
|
|
using MediaBrowser.Model.Entities;
|
2019-01-13 19:25:32 +00:00
|
|
|
using MediaBrowser.Model.Playlists;
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Playlists
|
|
|
|
{
|
|
|
|
public interface IPlaylistManager
|
|
|
|
{
|
2024-03-26 14:29:48 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the playlist.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="playlistId">The playlist identifier.</param>
|
2024-04-02 06:08:36 +00:00
|
|
|
/// <param name="userId">The user identifier.</param>
|
2024-03-26 14:29:48 +00:00
|
|
|
/// <returns>Playlist.</returns>
|
2024-04-02 06:08:36 +00:00
|
|
|
Playlist GetPlaylistForUser(Guid playlistId, Guid userId);
|
2024-03-26 14:29:48 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
2024-04-01 18:43:05 +00:00
|
|
|
/// Creates the playlist.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2024-04-01 18:43:05 +00:00
|
|
|
/// <param name="request">The <see cref="PlaylistCreationRequest"/>.</param>
|
2024-04-03 14:06:20 +00:00
|
|
|
/// <returns>The created playlist.</returns>
|
2024-04-01 18:43:05 +00:00
|
|
|
Task<PlaylistCreationResult> CreatePlaylist(PlaylistCreationRequest request);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2024-03-26 14:29:48 +00:00
|
|
|
/// <summary>
|
2024-04-01 18:43:05 +00:00
|
|
|
/// Updates a playlist.
|
2024-03-26 14:29:48 +00:00
|
|
|
/// </summary>
|
2024-04-01 18:43:05 +00:00
|
|
|
/// <param name="request">The <see cref="PlaylistUpdateRequest"/>.</param>
|
2024-03-26 14:29:48 +00:00
|
|
|
/// <returns>Task.</returns>
|
2024-04-01 18:43:05 +00:00
|
|
|
Task UpdatePlaylist(PlaylistUpdateRequest request);
|
|
|
|
|
|
|
|
/// <summary>
|
2024-05-06 01:22:21 +00:00
|
|
|
/// Gets all playlists a user has access to.
|
2024-04-01 18:43:05 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
/// <returns>IEnumerable<Playlist>.</returns>
|
|
|
|
IEnumerable<Playlist> GetPlaylists(Guid userId);
|
2024-03-26 14:29:48 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Adds a share to the playlist.
|
|
|
|
/// </summary>
|
2024-04-02 06:08:36 +00:00
|
|
|
/// <param name="request">The <see cref="PlaylistUserUpdateRequest"/>.</param>
|
2024-03-26 14:29:48 +00:00
|
|
|
/// <returns>Task.</returns>
|
2024-04-02 06:08:36 +00:00
|
|
|
Task AddUserToShares(PlaylistUserUpdateRequest request);
|
2024-03-26 14:29:48 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2024-04-02 06:08:36 +00:00
|
|
|
/// Removes a share from the playlist.
|
2024-03-26 14:29:48 +00:00
|
|
|
/// </summary>
|
|
|
|
/// <param name="playlistId">The playlist identifier.</param>
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
/// <param name="share">The share.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2024-04-02 06:08:36 +00:00
|
|
|
Task RemoveUserFromShares(Guid playlistId, Guid userId, PlaylistUserPermissions share);
|
2024-03-26 14:29:48 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Adds to playlist.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="playlistId">The playlist identifier.</param>
|
|
|
|
/// <param name="itemIds">The item ids.</param>
|
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2024-04-02 06:08:36 +00:00
|
|
|
Task AddItemToPlaylistAsync(Guid playlistId, IReadOnlyCollection<Guid> itemIds, Guid userId);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Removes from playlist.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="playlistId">The playlist identifier.</param>
|
|
|
|
/// <param name="entryIds">The entry ids.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2024-04-02 06:08:36 +00:00
|
|
|
Task RemoveItemFromPlaylistAsync(string playlistId, IEnumerable<string> entryIds);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the playlists folder.
|
|
|
|
/// </summary>
|
2023-09-16 13:08:45 +00:00
|
|
|
/// <returns>Folder.</returns>
|
|
|
|
Folder GetPlaylistsFolder();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the playlists folder for a user.
|
|
|
|
/// </summary>
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <param name="userId">The user identifier.</param>
|
|
|
|
/// <returns>Folder.</returns>
|
|
|
|
Folder GetPlaylistsFolder(Guid userId);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Moves the item.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="playlistId">The playlist identifier.</param>
|
|
|
|
/// <param name="entryId">The entry identifier.</param>
|
|
|
|
/// <param name="newIndex">The new index.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2020-08-21 20:01:19 +00:00
|
|
|
Task MoveItemAsync(string playlistId, string entryId, int newIndex);
|
2023-03-10 16:46:59 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Removed all playlists of a user.
|
|
|
|
/// If the playlist is shared, ownership is transferred.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="userId">The user id.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2023-03-12 18:42:18 +00:00
|
|
|
Task RemovePlaylistsAsync(Guid userId);
|
2023-03-10 18:16:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2023-05-15 12:45:33 +00:00
|
|
|
/// Saves a playlist.
|
2023-03-10 18:16:57 +00:00
|
|
|
/// </summary>
|
2023-05-15 12:45:33 +00:00
|
|
|
/// <param name="item">The playlist.</param>
|
|
|
|
void SavePlaylistFile(Playlist item);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|