From 2ce9e05d2fc818b031f2ab12bc50ffae035033ed Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 15 Apr 2014 22:17:48 -0400 Subject: add new playback checkin endpoints --- MediaBrowser.Controller/Session/ISessionManager.cs | 37 ++++++++---- MediaBrowser.Controller/Session/PlaybackInfo.cs | 56 ------------------ .../Session/PlaybackProgressInfo.cs | 62 ------------------- .../Session/PlaybackStopInfo.cs | 32 ---------- MediaBrowser.Controller/Session/SessionInfo.cs | 69 +++------------------- 5 files changed, 34 insertions(+), 222 deletions(-) delete mode 100644 MediaBrowser.Controller/Session/PlaybackInfo.cs delete mode 100644 MediaBrowser.Controller/Session/PlaybackProgressInfo.cs delete mode 100644 MediaBrowser.Controller/Session/PlaybackStopInfo.cs (limited to 'MediaBrowser.Controller/Session') diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index f2edca082..54f371631 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Session; using System; using System.Collections.Generic; @@ -68,7 +69,7 @@ namespace MediaBrowser.Controller.Session /// /// The info. /// Task. - Task OnPlaybackStart(PlaybackInfo info); + Task OnPlaybackStart(PlaybackStartInfo info); /// /// Used to report playback progress for an item @@ -91,7 +92,7 @@ namespace MediaBrowser.Controller.Session /// /// The session identifier. /// Task. - Task ReportSessionEnded(Guid sessionId); + Task ReportSessionEnded(string sessionId); /// /// Gets the session info dto. @@ -108,7 +109,7 @@ namespace MediaBrowser.Controller.Session /// The command. /// The cancellation token. /// Task. - Task SendGeneralCommand(Guid controllingSessionId, Guid sessionId, GeneralCommand command, CancellationToken cancellationToken); + Task SendGeneralCommand(string controllingSessionId, string sessionId, GeneralCommand command, CancellationToken cancellationToken); /// /// Sends the message command. @@ -118,7 +119,7 @@ namespace MediaBrowser.Controller.Session /// The command. /// The cancellation token. /// Task. - Task SendMessageCommand(Guid controllingSessionId, Guid sessionId, MessageCommand command, CancellationToken cancellationToken); + Task SendMessageCommand(string controllingSessionId, string sessionId, MessageCommand command, CancellationToken cancellationToken); /// /// Sends the play command. @@ -128,7 +129,7 @@ namespace MediaBrowser.Controller.Session /// The command. /// The cancellation token. /// Task. - Task SendPlayCommand(Guid controllingSessionId, Guid sessionId, PlayRequest command, CancellationToken cancellationToken); + Task SendPlayCommand(string controllingSessionId, string sessionId, PlayRequest command, CancellationToken cancellationToken); /// /// Sends the browse command. @@ -138,7 +139,7 @@ namespace MediaBrowser.Controller.Session /// The command. /// The cancellation token. /// Task. - Task SendBrowseCommand(Guid controllingSessionId, Guid sessionId, BrowseRequest command, CancellationToken cancellationToken); + Task SendBrowseCommand(string controllingSessionId, string sessionId, BrowseRequest command, CancellationToken cancellationToken); /// /// Sends the playstate command. @@ -148,7 +149,7 @@ namespace MediaBrowser.Controller.Session /// The command. /// The cancellation token. /// Task. - Task SendPlaystateCommand(Guid controllingSessionId, Guid sessionId, PlaystateRequest command, CancellationToken cancellationToken); + Task SendPlaystateCommand(string controllingSessionId, string sessionId, PlaystateRequest command, CancellationToken cancellationToken); /// /// Sends the restart required message. @@ -176,15 +177,31 @@ namespace MediaBrowser.Controller.Session /// /// The session identifier. /// The user identifier. - void AddAdditionalUser(Guid sessionId, Guid userId); + void AddAdditionalUser(string sessionId, Guid userId); /// /// Removes the additional user. /// /// The session identifier. /// The user identifier. - void RemoveAdditionalUser(Guid sessionId, Guid userId); + void RemoveAdditionalUser(string sessionId, Guid userId); + /// + /// Reports the now viewing item. + /// + /// The session identifier. + /// The item identifier. + /// The context. + void ReportNowViewingItem(string sessionId, string itemId, string context); + + /// + /// Reports the now viewing item. + /// + /// The session identifier. + /// The item. + /// The context. + void ReportNowViewingItem(string sessionId, BaseItemInfo item, string context); + /// /// Authenticates the new session. /// @@ -203,6 +220,6 @@ namespace MediaBrowser.Controller.Session /// /// The session identifier. /// The capabilities. - void ReportCapabilities(Guid sessionId, SessionCapabilities capabilities); + void ReportCapabilities(string sessionId, SessionCapabilities capabilities); } } \ No newline at end of file diff --git a/MediaBrowser.Controller/Session/PlaybackInfo.cs b/MediaBrowser.Controller/Session/PlaybackInfo.cs deleted file mode 100644 index 2e59b6b72..000000000 --- a/MediaBrowser.Controller/Session/PlaybackInfo.cs +++ /dev/null @@ -1,56 +0,0 @@ -using MediaBrowser.Controller.Entities; -using System; -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Session -{ - public class PlaybackInfo - { - public PlaybackInfo() - { - QueueableMediaTypes = new List(); - } - - /// - /// Gets or sets a value indicating whether this instance can seek. - /// - /// true if this instance can seek; otherwise, false. - public bool CanSeek { get; set; } - - /// - /// Gets or sets the queueable media types. - /// - /// The queueable media types. - public List QueueableMediaTypes { get; set; } - - /// - /// Gets or sets the item. - /// - /// The item. - public BaseItem Item { get; set; } - - /// - /// Gets or sets the session id. - /// - /// The session id. - public Guid SessionId { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - /// The media version identifier. - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the index of the audio stream. - /// - /// The index of the audio stream. - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the subtitle stream. - /// - /// The index of the subtitle stream. - public int? SubtitleStreamIndex { get; set; } - } -} diff --git a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs deleted file mode 100644 index 9f82fcdff..000000000 --- a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -using MediaBrowser.Controller.Entities; -using System; - -namespace MediaBrowser.Controller.Session -{ - public class PlaybackProgressInfo - { - /// - /// Gets or sets the item. - /// - /// The item. - public BaseItem Item { get; set; } - - /// - /// Gets or sets the session id. - /// - /// The session id. - public Guid SessionId { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is paused. - /// - /// true if this instance is paused; otherwise, false. - public bool IsPaused { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is muted. - /// - /// true if this instance is muted; otherwise, false. - public bool IsMuted { get; set; } - - /// - /// Gets or sets the position ticks. - /// - /// The position ticks. - public long? PositionTicks { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - /// The media version identifier. - public string MediaSourceId { get; set; } - - /// - /// Gets or sets the volume level. - /// - /// The volume level. - public int? VolumeLevel { get; set; } - - /// - /// Gets or sets the index of the audio stream. - /// - /// The index of the audio stream. - public int? AudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the subtitle stream. - /// - /// The index of the subtitle stream. - public int? SubtitleStreamIndex { get; set; } - } -} diff --git a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs b/MediaBrowser.Controller/Session/PlaybackStopInfo.cs deleted file mode 100644 index 063abf78c..000000000 --- a/MediaBrowser.Controller/Session/PlaybackStopInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -using MediaBrowser.Controller.Entities; -using System; - -namespace MediaBrowser.Controller.Session -{ - public class PlaybackStopInfo - { - /// - /// Gets or sets the item. - /// - /// The item. - public BaseItem Item { get; set; } - - /// - /// Gets or sets the session id. - /// - /// The session id. - public Guid SessionId { get; set; } - - /// - /// Gets or sets the position ticks. - /// - /// The position ticks. - public long? PositionTicks { get; set; } - - /// - /// Gets or sets the media version identifier. - /// - /// The media version identifier. - public string MediaSourceId { get; set; } - } -} diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 9fcb024e8..80a6b75a2 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -1,5 +1,4 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Entities; using MediaBrowser.Model.Session; using System; using System.Collections.Generic; @@ -26,8 +25,11 @@ namespace MediaBrowser.Controller.Session AdditionalUsers = new List(); SupportedCommands = new List(); + PlayState = new PlayerStateInfo(); } + public PlayerStateInfo PlayState { get; set; } + public List AdditionalUsers { get; set; } /// @@ -36,12 +38,6 @@ namespace MediaBrowser.Controller.Session /// The remote end point. public string RemoteEndPoint { get; set; } - /// - /// Gets or sets a value indicating whether this instance can seek. - /// - /// true if this instance can seek; otherwise, false. - public bool CanSeek { get; set; } - /// /// Gets or sets the queueable media types. /// @@ -58,7 +54,7 @@ namespace MediaBrowser.Controller.Session /// Gets or sets the id. /// /// The id. - public Guid Id { get; set; } + public string Id { get; set; } /// /// Gets or sets the user id. @@ -96,68 +92,17 @@ namespace MediaBrowser.Controller.Session /// The now viewing context. public string NowViewingContext { get; set; } - /// - /// Gets or sets the type of the now viewing item. - /// - /// The type of the now viewing item. - public string NowViewingItemType { get; set; } - - /// - /// Gets or sets the now viewing item identifier. - /// - /// The now viewing item identifier. - public string NowViewingItemId { get; set; } - /// /// Gets or sets the name of the now viewing item. /// /// The name of the now viewing item. - public string NowViewingItemName { get; set; } + public BaseItemInfo NowViewingItem { get; set; } /// /// Gets or sets the now playing item. /// /// The now playing item. - public BaseItem NowPlayingItem { get; set; } - - /// - /// Gets or sets the now playing media version identifier. - /// - /// The now playing media version identifier. - public string NowPlayingMediaSourceId { get; set; } - - /// - /// Gets or sets the now playing run time ticks. - /// - /// The now playing run time ticks. - public long? NowPlayingRunTimeTicks { get; set; } - - /// - /// Gets or sets the now playing position ticks. - /// - /// The now playing position ticks. - public long? NowPlayingPositionTicks { get; set; } - /// - /// Gets or sets a value indicating whether this instance is paused. - /// - /// true if this instance is paused; otherwise, false. - public bool IsPaused { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is muted. - /// - /// true if this instance is muted; otherwise, false. - public bool IsMuted { get; set; } - - /// - /// Gets or sets the volume level, on a scale of 0-100 - /// - /// The volume level. - public int? VolumeLevel { get; set; } - - public int? NowPlayingAudioStreamIndex { get; set; } - - public int? NowPlayingSubtitleStreamIndex { get; set; } + public BaseItemInfo NowPlayingItem { get; set; } /// /// Gets or sets the device id. -- cgit v1.2.3