You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Controller/Session/ISessionManager.cs

77 lines
3.0 KiB

using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.Session
{
/// <summary>
/// Interface ISessionManager
/// </summary>
public interface ISessionManager
{
/// <summary>
/// Occurs when [playback start].
/// </summary>
event EventHandler<PlaybackProgressEventArgs> PlaybackStart;
/// <summary>
/// Occurs when [playback progress].
/// </summary>
event EventHandler<PlaybackProgressEventArgs> PlaybackProgress;
/// <summary>
/// Occurs when [playback stopped].
/// </summary>
event EventHandler<PlaybackProgressEventArgs> PlaybackStopped;
/// <summary>
/// Gets the sessions.
/// </summary>
/// <value>The sessions.</value>
IEnumerable<SessionInfo> Sessions { get; }
/// <summary>
/// Logs the user activity.
/// </summary>
/// <param name="clientType">Type of the client.</param>
/// <param name="appVersion">The app version.</param>
/// <param name="deviceId">The device id.</param>
/// <param name="deviceName">Name of the device.</param>
/// <param name="user">The user.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException">user</exception>
Task<SessionInfo> LogConnectionActivity(string clientType, string appVersion, string deviceId, string deviceName, User user);
/// <summary>
/// Used to report that playback has started for an item
/// </summary>
/// <param name="item">The item.</param>
/// <param name="sessionId">The session id.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException"></exception>
Task OnPlaybackStart(BaseItem item, Guid sessionId);
/// <summary>
/// Used to report playback progress for an item
/// </summary>
/// <param name="item">The item.</param>
/// <param name="positionTicks">The position ticks.</param>
/// <param name="isPaused">if set to <c>true</c> [is paused].</param>
/// <param name="sessionId">The session id.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException"></exception>
Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, Guid sessionId);
/// <summary>
/// Used to report that playback has ended for an item
/// </summary>
/// <param name="item">The item.</param>
/// <param name="positionTicks">The position ticks.</param>
/// <param name="sessionId">The session id.</param>
/// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException"></exception>
Task OnPlaybackStopped(BaseItem item, long? positionTicks, Guid sessionId);
}
}