jellyfin/MediaBrowser.Controller/Playlists/IPlaylistManager.cs

113 lines
4 KiB
C#
Raw Normal View History

#pragma warning disable CS1591
using System;
2018-12-28 00:27:57 +01:00
using System.Collections.Generic;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities;
2024-03-26 15:29:48 +01:00
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Playlists;
2018-12-28 00:27:57 +01:00
namespace MediaBrowser.Controller.Playlists
{
public interface IPlaylistManager
{
2024-03-26 15:29:48 +01:00
/// <summary>
/// Gets the playlist.
/// </summary>
/// <param name="playlistId">The playlist identifier.</param>
2024-04-02 08:08:36 +02:00
/// <param name="userId">The user identifier.</param>
2024-03-26 15:29:48 +01:00
/// <returns>Playlist.</returns>
2024-04-02 08:08:36 +02:00
Playlist GetPlaylistForUser(Guid playlistId, Guid userId);
2024-03-26 15:29:48 +01:00
2018-12-28 00:27:57 +01:00
/// <summary>
2024-04-01 20:43:05 +02:00
/// Creates the playlist.
2018-12-28 00:27:57 +01:00
/// </summary>
2024-04-01 20:43:05 +02:00
/// <param name="request">The <see cref="PlaylistCreationRequest"/>.</param>
2024-04-03 16:06:20 +02:00
/// <returns>The created playlist.</returns>
2024-04-01 20:43:05 +02:00
Task<PlaylistCreationResult> CreatePlaylist(PlaylistCreationRequest request);
2018-12-28 00:27:57 +01:00
2024-03-26 15:29:48 +01:00
/// <summary>
2024-04-01 20:43:05 +02:00
/// Updates a playlist.
2024-03-26 15:29:48 +01:00
/// </summary>
2024-04-01 20:43:05 +02:00
/// <param name="request">The <see cref="PlaylistUpdateRequest"/>.</param>
2024-03-26 15:29:48 +01:00
/// <returns>Task.</returns>
2024-04-01 20:43:05 +02:00
Task UpdatePlaylist(PlaylistUpdateRequest request);
/// <summary>
/// Gets the playlists.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <returns>IEnumerable&lt;Playlist&gt;.</returns>
IEnumerable<Playlist> GetPlaylists(Guid userId);
2024-03-26 15:29:48 +01:00
/// <summary>
/// Adds a share to the playlist.
/// </summary>
2024-04-02 08:08:36 +02:00
/// <param name="request">The <see cref="PlaylistUserUpdateRequest"/>.</param>
2024-03-26 15:29:48 +01:00
/// <returns>Task.</returns>
2024-04-02 08:08:36 +02:00
Task AddUserToShares(PlaylistUserUpdateRequest request);
2024-03-26 15:29:48 +01:00
/// <summary>
2024-04-02 08:08:36 +02:00
/// Removes a share from the playlist.
2024-03-26 15:29:48 +01: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 08:08:36 +02:00
Task RemoveUserFromShares(Guid playlistId, Guid userId, PlaylistUserPermissions share);
2024-03-26 15:29:48 +01:00
2018-12-28 00:27:57 +01: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 08:08:36 +02:00
Task AddItemToPlaylistAsync(Guid playlistId, IReadOnlyCollection<Guid> itemIds, Guid userId);
2018-12-28 00:27:57 +01: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 08:08:36 +02:00
Task RemoveItemFromPlaylistAsync(string playlistId, IEnumerable<string> entryIds);
2018-12-28 00:27:57 +01:00
/// <summary>
/// Gets the playlists folder.
/// </summary>
/// <returns>Folder.</returns>
Folder GetPlaylistsFolder();
/// <summary>
/// Gets the playlists folder for a user.
/// </summary>
2018-12-28 00:27:57 +01: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 22:01:19 +02:00
Task MoveItemAsync(string playlistId, string entryId, int newIndex);
2023-03-10 17:46:59 +01: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 19:42:18 +01:00
Task RemovePlaylistsAsync(Guid userId);
/// <summary>
/// Saves a playlist.
/// </summary>
/// <param name="item">The playlist.</param>
void SavePlaylistFile(Playlist item);
2018-12-28 00:27:57 +01:00
}
}