From c60103df64104459883f1244363cc9cd39187545 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 6 Apr 2014 13:53:23 -0400 Subject: chromecast updates --- MediaBrowser.Controller/Dto/IDtoService.cs | 9 --------- MediaBrowser.Controller/MediaBrowser.Controller.csproj | 1 + MediaBrowser.Controller/Session/ISessionController.cs | 8 ++++++++ MediaBrowser.Controller/Session/ISessionManager.cs | 17 +++++++++++++++++ MediaBrowser.Controller/Session/PlaybackInfo.cs | 12 ++++++++++++ .../Session/PlaybackProgressInfo.cs | 18 ++++++++++++++++++ MediaBrowser.Controller/Session/SessionEventArgs.cs | 9 +++++++++ MediaBrowser.Controller/Session/SessionInfo.cs | 11 ++++++++++- 8 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 MediaBrowser.Controller/Session/SessionEventArgs.cs (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/Dto/IDtoService.cs b/MediaBrowser.Controller/Dto/IDtoService.cs index 2704959e40..d07deaf233 100644 --- a/MediaBrowser.Controller/Dto/IDtoService.cs +++ b/MediaBrowser.Controller/Dto/IDtoService.cs @@ -1,9 +1,7 @@ using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Session; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Querying; -using MediaBrowser.Model.Session; using System; using System.Collections.Generic; @@ -21,13 +19,6 @@ namespace MediaBrowser.Controller.Dto /// UserDto. UserDto GetUserDto(User user); - /// - /// Gets the session info dto. - /// - /// The session. - /// SessionInfoDto. - SessionInfoDto GetSessionInfoDto(SessionInfo session); - /// /// Gets the dto id. /// diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 760d07611d..3082d12ca5 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -253,6 +253,7 @@ + diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs index cf57f6621e..1d5fbf3590 100644 --- a/MediaBrowser.Controller/Session/ISessionController.cs +++ b/MediaBrowser.Controller/Session/ISessionController.cs @@ -89,6 +89,14 @@ namespace MediaBrowser.Controller.Session /// Task. Task SendServerShutdownNotification(CancellationToken cancellationToken); + /// + /// Sends the session ended notification. + /// + /// The session information. + /// The cancellation token. + /// Task. + Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken); + /// /// Sends the server restart notification. /// diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 434c513360..f2edca082c 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -28,6 +28,16 @@ namespace MediaBrowser.Controller.Session /// event EventHandler PlaybackStopped; + /// + /// Occurs when [session started]. + /// + event EventHandler SessionStarted; + + /// + /// Occurs when [session ended]. + /// + event EventHandler SessionEnded; + /// /// Gets the sessions. /// @@ -83,6 +93,13 @@ namespace MediaBrowser.Controller.Session /// Task. Task ReportSessionEnded(Guid sessionId); + /// + /// Gets the session info dto. + /// + /// The session. + /// SessionInfoDto. + SessionInfoDto GetSessionInfoDto(SessionInfo session); + /// /// Sends the general command. /// diff --git a/MediaBrowser.Controller/Session/PlaybackInfo.cs b/MediaBrowser.Controller/Session/PlaybackInfo.cs index a97f9e0d03..2e59b6b729 100644 --- a/MediaBrowser.Controller/Session/PlaybackInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackInfo.cs @@ -40,5 +40,17 @@ namespace MediaBrowser.Controller.Session /// /// 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 index 3d402aa6ff..9f82fcdffc 100644 --- a/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs +++ b/MediaBrowser.Controller/Session/PlaybackProgressInfo.cs @@ -40,5 +40,23 @@ namespace MediaBrowser.Controller.Session /// /// 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/SessionEventArgs.cs b/MediaBrowser.Controller/Session/SessionEventArgs.cs new file mode 100644 index 0000000000..96daa6ec93 --- /dev/null +++ b/MediaBrowser.Controller/Session/SessionEventArgs.cs @@ -0,0 +1,9 @@ +using System; + +namespace MediaBrowser.Controller.Session +{ + public class SessionEventArgs : EventArgs + { + public SessionInfo SessionInfo { get; set; } + } +} diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index ef39977f03..9fcb024e8f 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -126,7 +126,6 @@ namespace MediaBrowser.Controller.Session /// The now playing media version identifier. public string NowPlayingMediaSourceId { get; set; } - /// /// Gets or sets the now playing run time ticks. /// @@ -150,6 +149,16 @@ namespace MediaBrowser.Controller.Session /// 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; } + /// /// Gets or sets the device id. /// -- cgit v1.2.3 From 56c0d491f4c05a2c0c4f21c20e3530c039b33148 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 6 Apr 2014 22:10:38 -0400 Subject: fixes #769 - Artists pages don't include music videos --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 6 +++--- MediaBrowser.Api/UserLibrary/ArtistsService.cs | 8 +++----- .../Entities/Audio/IHasAlbumArtist.cs | 5 ++++- MediaBrowser.Controller/Entities/MusicVideo.cs | 19 +++++++++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index fe45cd39e3..612f731918 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1368,7 +1368,7 @@ namespace MediaBrowser.Api.Playback mediaUrl = streamInfo.Url; } - if (!string.IsNullOrEmpty(path) && File.Exists(path)) + if (!string.IsNullOrEmpty(path)) { state.MediaPath = path; state.IsRemote = false; @@ -1381,7 +1381,7 @@ namespace MediaBrowser.Api.Playback state.RunTimeTicks = recording.RunTimeTicks; - if (recording.RecordingInfo.Status == RecordingStatus.InProgress && !state.IsRemote) + if (recording.RecordingInfo.Status == RecordingStatus.InProgress) { await Task.Delay(1000, cancellationToken).ConfigureAwait(false); } @@ -1404,7 +1404,7 @@ namespace MediaBrowser.Api.Playback state.LiveTvStreamId = streamInfo.Id; - if (!string.IsNullOrEmpty(streamInfo.Path) && File.Exists(streamInfo.Path)) + if (!string.IsNullOrEmpty(streamInfo.Path)) { state.MediaPath = streamInfo.Path; state.IsRemote = false; diff --git a/MediaBrowser.Api/UserLibrary/ArtistsService.cs b/MediaBrowser.Api/UserLibrary/ArtistsService.cs index 9972ac3eff..5ca0d75ac9 100644 --- a/MediaBrowser.Api/UserLibrary/ArtistsService.cs +++ b/MediaBrowser.Api/UserLibrary/ArtistsService.cs @@ -15,14 +15,12 @@ namespace MediaBrowser.Api.UserLibrary /// /// Class GetArtists /// - [Route("/Artists", "GET")] - [Api(Description = "Gets all artists from a given item, folder, or the entire library")] + [Route("/Artists", "GET", Summary = "Gets all artists from a given item, folder, or the entire library")] public class GetArtists : GetItemsByName { } - [Route("/Artists/{Name}", "GET")] - [Api(Description = "Gets an artist, by name")] + [Route("/Artists/{Name}", "GET", Summary = "Gets an artist, by name")] public class GetArtist : IReturn { /// @@ -112,7 +110,7 @@ namespace MediaBrowser.Api.UserLibrary protected override IEnumerable GetAllItems(GetItemsByName request, IEnumerable items) { return items - .OfType