2020-04-01 15:52:42 +00:00
|
|
|
using System;
|
2020-05-04 17:46:02 +00:00
|
|
|
using System.Threading;
|
2020-09-24 21:04:21 +00:00
|
|
|
using Jellyfin.Data.Entities;
|
2020-04-01 15:52:42 +00:00
|
|
|
using MediaBrowser.Controller.Session;
|
2020-05-06 21:42:53 +00:00
|
|
|
using MediaBrowser.Model.SyncPlay;
|
2020-04-01 15:52:42 +00:00
|
|
|
|
2020-05-06 21:42:53 +00:00
|
|
|
namespace MediaBrowser.Controller.SyncPlay
|
2020-04-01 15:52:42 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// Interface ISyncPlayGroupController.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
public interface ISyncPlayGroupController
|
2020-04-01 15:52:42 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// Gets the group identifier.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <value>The group identifier.</value>
|
|
|
|
Guid GroupId { get; }
|
2020-04-01 15:52:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// Gets the play queue.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <value>The play queue.</value>
|
|
|
|
PlayQueueManager PlayQueue { get; }
|
2020-04-01 15:52:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks if the group is empty.
|
|
|
|
/// </summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <returns>If the group is empty.</returns>
|
2020-04-01 15:52:42 +00:00
|
|
|
bool IsGroupEmpty();
|
|
|
|
|
|
|
|
/// <summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// Initializes the group with the session's info.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// <param name="session">The session.</param>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <param name="request">The request.</param>
|
2020-05-04 17:46:02 +00:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2020-09-24 21:04:21 +00:00
|
|
|
void CreateGroup(SessionInfo session, NewGroupRequest request, CancellationToken cancellationToken);
|
2020-04-01 15:52:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// Adds the session to the group.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// <param name="session">The session.</param>
|
2020-04-15 16:03:58 +00:00
|
|
|
/// <param name="request">The request.</param>
|
2020-05-04 17:46:02 +00:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SessionJoin(SessionInfo session, JoinGroupRequest request, CancellationToken cancellationToken);
|
2020-04-01 15:52:42 +00:00
|
|
|
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Restores the state of a session that already joined the group.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="session">The session.</param>
|
|
|
|
/// <param name="request">The request.</param>
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SessionRestore(SessionInfo session, JoinGroupRequest request, CancellationToken cancellationToken);
|
|
|
|
|
2020-04-01 15:52:42 +00:00
|
|
|
/// <summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// Removes the session from the group.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// <param name="session">The session.</param>
|
2020-05-04 17:46:02 +00:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
void SessionLeave(SessionInfo session, CancellationToken cancellationToken);
|
2020-04-01 15:52:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// Handles the requested action by the session.
|
2020-04-01 15:52:42 +00:00
|
|
|
/// </summary>
|
2020-04-04 15:56:21 +00:00
|
|
|
/// <param name="session">The session.</param>
|
2020-04-01 15:52:42 +00:00
|
|
|
/// <param name="request">The requested action.</param>
|
2020-05-04 17:46:02 +00:00
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
2020-05-12 17:05:05 +00:00
|
|
|
void HandleRequest(SessionInfo session, IPlaybackGroupRequest request, CancellationToken cancellationToken);
|
2020-04-01 15:52:42 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the info about the group for the clients.
|
|
|
|
/// </summary>
|
2020-09-24 21:04:21 +00:00
|
|
|
/// <returns>The group info for the clients.</returns>
|
2020-05-12 07:08:35 +00:00
|
|
|
GroupInfoDto GetInfo();
|
2020-09-24 21:04:21 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Checks if a user has access to all content in the play queue.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="user">The user.</param>
|
|
|
|
/// <returns><c>true</c> if the user can access the play queue; <c>false</c> otherwise.</returns>
|
|
|
|
bool HasAccessToPlayQueue(User user);
|
|
|
|
|
2020-04-01 15:52:42 +00:00
|
|
|
}
|
2020-08-22 19:56:24 +00:00
|
|
|
}
|