diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-29 17:00:27 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-29 17:00:27 -0400 |
| commit | 982a30394018a9262aae0fafc56c736635ba27ed (patch) | |
| tree | 41e942f3df0b6cbae9a677bb3edbb4d43af40e9a | |
| parent | 528292e496ef1cb6e226937f09774e57996d03db (diff) | |
added IsMuted to playback progress
17 files changed, 63 insertions, 26 deletions
diff --git a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs index 304ff27d0..a6c53b4a4 100644 --- a/MediaBrowser.Api/UserLibrary/UserLibraryService.cs +++ b/MediaBrowser.Api/UserLibrary/UserLibraryService.cs @@ -265,6 +265,9 @@ namespace MediaBrowser.Api.UserLibrary [ApiMember(Name = "IsPaused", Description = "Indicates if the player is paused.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "POST")] public bool IsPaused { get; set; } + + [ApiMember(Name = "IsMuted", Description = "Indicates if the player is muted.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "POST")] + public bool IsMuted { get; set; } } /// <summary> @@ -640,7 +643,7 @@ namespace MediaBrowser.Api.UserLibrary var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id); - var task = _sessionManager.OnPlaybackProgress(item, request.PositionTicks, request.IsPaused, GetSession().Id); + var task = _sessionManager.OnPlaybackProgress(item, request.PositionTicks, request.IsPaused, request.IsMuted, GetSession().Id); Task.WaitAll(task); } diff --git a/MediaBrowser.Controller/Dto/SessionInfoDtoBuilder.cs b/MediaBrowser.Controller/Dto/SessionInfoDtoBuilder.cs index bd8eb41e3..01baa7356 100644 --- a/MediaBrowser.Controller/Dto/SessionInfoDtoBuilder.cs +++ b/MediaBrowser.Controller/Dto/SessionInfoDtoBuilder.cs @@ -25,6 +25,7 @@ namespace MediaBrowser.Controller.Dto NowPlayingPositionTicks = session.NowPlayingPositionTicks, SupportsRemoteControl = session.SupportsRemoteControl, IsPaused = session.IsPaused, + IsMuted = session.IsMuted, NowViewingContext = session.NowViewingContext, NowViewingItemId = session.NowViewingItemId, NowViewingItemName = session.NowViewingItemName, diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index a75dc47e1..3c8c2411e 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -1211,7 +1211,7 @@ namespace MediaBrowser.Controller.Entities else { // Check for dupes based on the combination of Name and Type - if (!People.Any(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && p.Type.Equals(person.Type, StringComparison.OrdinalIgnoreCase))) + if (!People.Any(p => string.Equals(p.Name, person.Name, StringComparison.OrdinalIgnoreCase) && string.Equals(p.Type, person.Type, StringComparison.OrdinalIgnoreCase))) { People.Add(person); } diff --git a/MediaBrowser.Controller/Entities/Trailer.cs b/MediaBrowser.Controller/Entities/Trailer.cs index ed20d05b0..044de3d6b 100644 --- a/MediaBrowser.Controller/Entities/Trailer.cs +++ b/MediaBrowser.Controller/Entities/Trailer.cs @@ -1,4 +1,5 @@ using System.Runtime.Serialization; +using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Entities { @@ -47,5 +48,17 @@ namespace MediaBrowser.Controller.Entities { get { return !IsLocalTrailer; } } + + public override string GetUserDataKey() + { + var key = this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? this.GetProviderId(MetadataProviders.Tvcom); + + if (!string.IsNullOrWhiteSpace(key)) + { + return key + "-trailer"; + } + + return base.GetUserDataKey(); + } } } diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs index 2af2bbec9..1976c653a 100644 --- a/MediaBrowser.Controller/Session/ISessionManager.cs +++ b/MediaBrowser.Controller/Session/ISessionManager.cs @@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Session /// <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); + Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, bool isMuted, Guid sessionId); /// <summary> /// Used to report that playback has ended for an item diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index 177573de6..6c0f1a085 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -87,9 +87,15 @@ namespace MediaBrowser.Controller.Session /// Gets or sets a value indicating whether this instance is paused. /// </summary> /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> - public bool? IsPaused { get; set; } + public bool IsPaused { get; set; } /// <summary> + /// Gets or sets a value indicating whether this instance is muted. + /// </summary> + /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value> + public bool IsMuted { get; set; } + + /// <summary> /// Gets or sets the device id. /// </summary> /// <value>The device id.</value> diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index eaa3dc15a..f4483e2e2 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -467,7 +467,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="isPaused">if set to <c>true</c> [is paused].</param> /// <returns>Task{UserItemDataDto}.</returns> /// <exception cref="ArgumentNullException">itemId</exception> - Task ReportPlaybackProgressAsync(string itemId, string userId, long? positionTicks, bool isPaused); + Task ReportPlaybackProgressAsync(string itemId, string userId, long? positionTicks, bool isPaused, bool isMuted); /// <summary> /// Reports to the server that the user has stopped playing an item @@ -588,7 +588,7 @@ namespace MediaBrowser.Model.ApiClient /// <param name="displayPreferences">The display preferences.</param> /// <returns>Task{DisplayPreferences}.</returns> /// <exception cref="System.ArgumentNullException">userId</exception> - Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences, string userId, string client); + Task UpdateDisplayPreferencesAsync(DisplayPreferences displayPreferences, string userId, string client, CancellationToken cancellationToken); /// <summary> /// Posts a set of data to a url, and deserializes the return stream into T diff --git a/MediaBrowser.Model/Session/SessionInfoDto.cs b/MediaBrowser.Model/Session/SessionInfoDto.cs index cddfecdd1..11fc3479b 100644 --- a/MediaBrowser.Model/Session/SessionInfoDto.cs +++ b/MediaBrowser.Model/Session/SessionInfoDto.cs @@ -75,9 +75,15 @@ namespace MediaBrowser.Model.Session /// Gets or sets a value indicating whether this instance is paused. /// </summary> /// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> - public bool? IsPaused { get; set; } + public bool IsPaused { get; set; } /// <summary> + /// Gets or sets a value indicating whether this instance is muted. + /// </summary> + /// <value><c>true</c> if this instance is muted; otherwise, <c>false</c>.</value> + public bool IsMuted { get; set; } + + /// <summary> /// Gets or sets the now playing item. /// </summary> /// <value>The now playing item.</value> diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs index 9f89300ae..edaef5b04 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeAudioInfoProvider.cs @@ -108,6 +108,8 @@ namespace MediaBrowser.Providers.MediaInfo if (!audio.LockedFields.Contains(MetadataFields.Cast)) { + audio.People.Clear(); + var composer = GetDictionaryValue(tags, "composer"); if (!string.IsNullOrWhiteSpace(composer)) diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs index d62baddec..18f464141 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs @@ -106,14 +106,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies return FindMovie<AdultVideo>(args.Path, args.FileSystemChildren); } - if (!string.IsNullOrEmpty(collectionType) && - !string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) && - !string.Equals(collectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase)) + if (string.IsNullOrEmpty(collectionType) || + string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) || + string.Equals(collectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase)) { - return null; + return FindMovie<Movie>(args.Path, args.FileSystemChildren); } - return FindMovie<Movie>(args.Path, args.FileSystemChildren); + return null; } // Find movies that are mixed in the same folder diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index 697e13517..4ba0a22ee 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -159,8 +159,9 @@ namespace MediaBrowser.Server.Implementations.Session /// <param name="item">The item.</param> /// <param name="isPaused">if set to <c>true</c> [is paused].</param> /// <param name="currentPositionTicks">The current position ticks.</param> - private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, bool isPaused, long? currentPositionTicks = null) + private void UpdateNowPlayingItem(SessionInfo session, BaseItem item, bool isPaused, bool isMuted, long? currentPositionTicks = null) { + session.IsMuted = isMuted; session.IsPaused = isPaused; session.NowPlayingPositionTicks = currentPositionTicks; session.NowPlayingItem = item; @@ -178,7 +179,7 @@ namespace MediaBrowser.Server.Implementations.Session { session.NowPlayingItem = null; session.NowPlayingPositionTicks = null; - session.IsPaused = null; + session.IsPaused = false; } } @@ -225,7 +226,7 @@ namespace MediaBrowser.Server.Implementations.Session var session = Sessions.First(i => i.Id.Equals(sessionId)); - UpdateNowPlayingItem(session, item, false); + UpdateNowPlayingItem(session, item, false, false); var key = item.GetUserDataKey(); @@ -262,7 +263,7 @@ namespace MediaBrowser.Server.Implementations.Session /// <returns>Task.</returns> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentOutOfRangeException">positionTicks</exception> - public async Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, Guid sessionId) + public async Task OnPlaybackProgress(BaseItem item, long? positionTicks, bool isPaused, bool isMuted, Guid sessionId) { if (item == null) { @@ -276,7 +277,7 @@ namespace MediaBrowser.Server.Implementations.Session var session = Sessions.First(i => i.Id.Equals(sessionId)); - UpdateNowPlayingItem(session, item, isPaused, positionTicks); + UpdateNowPlayingItem(session, item, isPaused, isMuted, positionTicks); var key = item.GetUserDataKey(); diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs index 40c06fdf2..893a6e49e 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs @@ -137,8 +137,9 @@ namespace MediaBrowser.Server.Implementations.Session } var isPaused = vals.Length > 2 && string.Equals(vals[2], "true", StringComparison.OrdinalIgnoreCase); + var isMuted = vals.Length > 3 && string.Equals(vals[3], "true", StringComparison.OrdinalIgnoreCase); - _sessionManager.OnPlaybackProgress(item, positionTicks, isPaused, session.Id); + _sessionManager.OnPlaybackProgress(item, positionTicks, isPaused, isMuted, session.Id); } } else if (string.Equals(message.MessageType, "PlaybackStopped", StringComparison.OrdinalIgnoreCase)) diff --git a/MediaBrowser.WebDashboard/ApiClient.js b/MediaBrowser.WebDashboard/ApiClient.js index 6262d760e..8666006f5 100644 --- a/MediaBrowser.WebDashboard/ApiClient.js +++ b/MediaBrowser.WebDashboard/ApiClient.js @@ -3354,7 +3354,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { * @param {String} userId * @param {String} itemId */ - self.reportPlaybackProgress = function (userId, itemId, positionTicks, isPaused) { + self.reportPlaybackProgress = function (userId, itemId, positionTicks, isPaused, isMuted) { if (!userId) { throw new Error("null userId"); @@ -3368,13 +3368,17 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { var deferred = $.Deferred(); - self.sendWebSocketMessage("PlaybackProgress", itemId + "|" + (positionTicks == null ? "" : positionTicks) + "|" + (isPaused == null ? "" : isPaused)); + var msgData = itemId + "|" + (positionTicks == null ? "" : positionTicks) + "|" + (isPaused == null ? "" : isPaused) + "|" + (isMuted == null ? "" : isMuted); + + self.sendWebSocketMessage("PlaybackProgress", msgData;); deferred.resolveWith(null, []); return deferred.promise(); } var params = { + isPaused: isPaused, + isMuted: isMuted }; if (positionTicks) { diff --git a/MediaBrowser.WebDashboard/packages.config b/MediaBrowser.WebDashboard/packages.config index 9f7b690af..94873bf7d 100644 --- a/MediaBrowser.WebDashboard/packages.config +++ b/MediaBrowser.WebDashboard/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="MediaBrowser.ApiClient.Javascript" version="3.0.165" targetFramework="net45" /> + <package id="MediaBrowser.ApiClient.Javascript" version="3.0.166" targetFramework="net45" /> <package id="ServiceStack.Common" version="3.9.58" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.58" targetFramework="net45" /> </packages>
\ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 11868b700..156b69094 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.187</version> + <version>3.0.188</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.187" /> + <dependency id="MediaBrowser.Common" version="3.0.188" /> <dependency id="NLog" version="2.0.1.2" /> <dependency id="ServiceStack.Text" version="3.9.55" /> <dependency id="SimpleInjector" version="2.3.0" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index b4f36a682..e1e4adcb1 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.187</version> + <version>3.0.188</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index fc070f572..303838866 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.187</version> + <version>3.0.188</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.187" /> + <dependency id="MediaBrowser.Common" version="3.0.188" /> </dependencies> </metadata> <files> |
