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.Model/Session/PlaybackReports.cs | 118 ++++++++++++++++++++------ MediaBrowser.Model/Session/SessionInfoDto.cs | 91 ++++++++++++-------- 2 files changed, 148 insertions(+), 61 deletions(-) (limited to 'MediaBrowser.Model/Session') diff --git a/MediaBrowser.Model/Session/PlaybackReports.cs b/MediaBrowser.Model/Session/PlaybackReports.cs index b2361b876..24594fcb1 100644 --- a/MediaBrowser.Model/Session/PlaybackReports.cs +++ b/MediaBrowser.Model/Session/PlaybackReports.cs @@ -1,29 +1,23 @@ - +using System.Collections.Generic; +using MediaBrowser.Model.Entities; + namespace MediaBrowser.Model.Session { /// /// Class PlaybackStartInfo. /// - public class PlaybackStartInfo + public class PlaybackStartInfo : PlaybackProgressInfo { - public string UserId { get; set; } - - public string ItemId { get; set; } - - public string MediaSourceId { get; set; } - - public bool IsSeekable { get; set; } - - public string[] QueueableMediaTypes { get; set; } - - public int? AudioStreamIndex { get; set; } - - public int? SubtitleStreamIndex { get; set; } - public PlaybackStartInfo() { - QueueableMediaTypes = new string[] { }; + QueueableMediaTypes = new List(); } + + /// + /// Gets or sets the queueable media types. + /// + /// The queueable media types. + public List QueueableMediaTypes { get; set; } } /// @@ -31,22 +25,70 @@ namespace MediaBrowser.Model.Session /// public class PlaybackProgressInfo { - public string UserId { 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 item. + /// + /// The item. + public BaseItemInfo Item { get; set; } + + /// + /// Gets or sets the item identifier. + /// + /// The item identifier. public string ItemId { get; set; } - + + /// + /// Gets or sets the session id. + /// + /// The session id. + public string SessionId { get; set; } + + /// + /// Gets or sets the media version identifier. + /// + /// The media version identifier. public string MediaSourceId { get; set; } - public long? PositionTicks { 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; } + /// + /// 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; } - public int? AudioStreamIndex { get; set; } - - public int? SubtitleStreamIndex { get; set; } + /// + /// Gets or sets the position ticks. + /// + /// The position ticks. + public long? PositionTicks { get; set; } + /// + /// Gets or sets the volume level. + /// + /// The volume level. public int? VolumeLevel { get; set; } } @@ -55,12 +97,34 @@ namespace MediaBrowser.Model.Session /// public class PlaybackStopInfo { - public string UserId { get; set; } - + /// + /// Gets or sets the item. + /// + /// The item. + public BaseItemInfo Item { get; set; } + + /// + /// Gets or sets the item identifier. + /// + /// The item identifier. public string ItemId { get; set; } - + + /// + /// Gets or sets the session id. + /// + /// The session id. + public string SessionId { get; set; } + + /// + /// Gets or sets the media version identifier. + /// + /// The media version identifier. public string MediaSourceId { get; set; } + /// + /// Gets or sets the position ticks. + /// + /// The position ticks. public long? PositionTicks { get; set; } } } diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs index 3754b07c7..b9dcf996e 100644 --- a/MediaBrowser.Model/Session/SessionInfoDto.cs +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -94,22 +94,10 @@ namespace MediaBrowser.Model.Session public string NowViewingContext { get; set; } /// - /// Gets or sets the type of the now viewing item. + /// Gets or sets 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; } + /// The now viewing item. + public BaseItemInfo NowViewingItem { get; set; } /// /// Gets or sets the name of the device. @@ -117,24 +105,6 @@ namespace MediaBrowser.Model.Session /// The name of the device. public string DeviceName { get; set; } - /// - /// Gets or sets the volume level. - /// - /// The volume level. - public int? VolumeLevel { get; set; } - - /// - /// Gets or sets the index of the now playing audio stream. - /// - /// The index of the now playing audio stream. - public int? NowPlayingAudioStreamIndex { get; set; } - - /// - /// Gets or sets the index of the now playing subtitle stream. - /// - /// The index of the now playing subtitle stream. - public int? NowPlayingSubtitleStreamIndex { get; set; } - /// /// Gets or sets a value indicating whether this instance is paused. /// @@ -170,7 +140,9 @@ namespace MediaBrowser.Model.Session /// /// true if [supports remote control]; otherwise, false. public bool SupportsRemoteControl { get; set; } - + + public PlayerStateInfo PlayState { get; set; } + public event PropertyChangedEventHandler PropertyChanged; public SessionInfoDto() @@ -211,4 +183,55 @@ namespace MediaBrowser.Model.Session SupportedCommands = new List(); } } + + public class PlayerStateInfo + { + /// + /// Gets or sets the now playing position ticks. + /// + /// The now playing position ticks. + public long? PositionTicks { 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 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. + /// + /// The volume level. + public int? VolumeLevel { get; set; } + + /// + /// Gets or sets the index of the now playing audio stream. + /// + /// The index of the now playing audio stream. + public int? AudioStreamIndex { get; set; } + + /// + /// Gets or sets the index of the now playing subtitle stream. + /// + /// The index of the now playing subtitle stream. + public int? SubtitleStreamIndex { get; set; } + + /// + /// Gets or sets the now playing media version identifier. + /// + /// The now playing media version identifier. + public string MediaSourceId { get; set; } + } } -- cgit v1.2.3