added IsMuted to playback progress

pull/702/head
Luke Pulverenti 11 years ago
parent 528292e496
commit 982a303940

@ -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")] [ApiMember(Name = "IsPaused", Description = "Indicates if the player is paused.", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "POST")]
public bool IsPaused { get; set; } 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> /// <summary>
@ -640,7 +643,7 @@ namespace MediaBrowser.Api.UserLibrary
var item = DtoBuilder.GetItemByClientId(request.Id, _userManager, _libraryManager, user.Id); 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); Task.WaitAll(task);
} }

@ -25,6 +25,7 @@ namespace MediaBrowser.Controller.Dto
NowPlayingPositionTicks = session.NowPlayingPositionTicks, NowPlayingPositionTicks = session.NowPlayingPositionTicks,
SupportsRemoteControl = session.SupportsRemoteControl, SupportsRemoteControl = session.SupportsRemoteControl,
IsPaused = session.IsPaused, IsPaused = session.IsPaused,
IsMuted = session.IsMuted,
NowViewingContext = session.NowViewingContext, NowViewingContext = session.NowViewingContext,
NowViewingItemId = session.NowViewingItemId, NowViewingItemId = session.NowViewingItemId,
NowViewingItemName = session.NowViewingItemName, NowViewingItemName = session.NowViewingItemName,

@ -1211,7 +1211,7 @@ namespace MediaBrowser.Controller.Entities
else else
{ {
// Check for dupes based on the combination of Name and Type // 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); People.Add(person);
} }

@ -1,4 +1,5 @@
using System.Runtime.Serialization; using System.Runtime.Serialization;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {
@ -47,5 +48,17 @@ namespace MediaBrowser.Controller.Entities
{ {
get { return !IsLocalTrailer; } 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();
}
} }
} }

@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Session
/// <param name="sessionId">The session id.</param> /// <param name="sessionId">The session id.</param>
/// <returns>Task.</returns> /// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException"></exception> /// <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> /// <summary>
/// Used to report that playback has ended for an item /// Used to report that playback has ended for an item

@ -87,8 +87,14 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets a value indicating whether this instance is paused. /// Gets or sets a value indicating whether this instance is paused.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> /// <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> /// <summary>
/// Gets or sets the device id. /// Gets or sets the device id.
/// </summary> /// </summary>

@ -467,7 +467,7 @@ namespace MediaBrowser.Model.ApiClient
/// <param name="isPaused">if set to <c>true</c> [is paused].</param> /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
/// <returns>Task{UserItemDataDto}.</returns> /// <returns>Task{UserItemDataDto}.</returns>
/// <exception cref="ArgumentNullException">itemId</exception> /// <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> /// <summary>
/// Reports to the server that the user has stopped playing an item /// 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> /// <param name="displayPreferences">The display preferences.</param>
/// <returns>Task{DisplayPreferences}.</returns> /// <returns>Task{DisplayPreferences}.</returns>
/// <exception cref="System.ArgumentNullException">userId</exception> /// <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> /// <summary>
/// Posts a set of data to a url, and deserializes the return stream into T /// Posts a set of data to a url, and deserializes the return stream into T

@ -75,8 +75,14 @@ namespace MediaBrowser.Model.Session
/// Gets or sets a value indicating whether this instance is paused. /// Gets or sets a value indicating whether this instance is paused.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is paused; otherwise, <c>false</c>.</value> /// <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> /// <summary>
/// Gets or sets the now playing item. /// Gets or sets the now playing item.
/// </summary> /// </summary>

@ -108,6 +108,8 @@ namespace MediaBrowser.Providers.MediaInfo
if (!audio.LockedFields.Contains(MetadataFields.Cast)) if (!audio.LockedFields.Contains(MetadataFields.Cast))
{ {
audio.People.Clear();
var composer = GetDictionaryValue(tags, "composer"); var composer = GetDictionaryValue(tags, "composer");
if (!string.IsNullOrWhiteSpace(composer)) if (!string.IsNullOrWhiteSpace(composer))

@ -106,14 +106,14 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
return FindMovie<AdultVideo>(args.Path, args.FileSystemChildren); return FindMovie<AdultVideo>(args.Path, args.FileSystemChildren);
} }
if (!string.IsNullOrEmpty(collectionType) && if (string.IsNullOrEmpty(collectionType) ||
!string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) && string.Equals(collectionType, CollectionType.Movies, StringComparison.OrdinalIgnoreCase) ||
!string.Equals(collectionType, CollectionType.BoxSets, 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 // Find movies that are mixed in the same folder

@ -159,8 +159,9 @@ namespace MediaBrowser.Server.Implementations.Session
/// <param name="item">The item.</param> /// <param name="item">The item.</param>
/// <param name="isPaused">if set to <c>true</c> [is paused].</param> /// <param name="isPaused">if set to <c>true</c> [is paused].</param>
/// <param name="currentPositionTicks">The current position ticks.</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.IsPaused = isPaused;
session.NowPlayingPositionTicks = currentPositionTicks; session.NowPlayingPositionTicks = currentPositionTicks;
session.NowPlayingItem = item; session.NowPlayingItem = item;
@ -178,7 +179,7 @@ namespace MediaBrowser.Server.Implementations.Session
{ {
session.NowPlayingItem = null; session.NowPlayingItem = null;
session.NowPlayingPositionTicks = 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)); var session = Sessions.First(i => i.Id.Equals(sessionId));
UpdateNowPlayingItem(session, item, false); UpdateNowPlayingItem(session, item, false, false);
var key = item.GetUserDataKey(); var key = item.GetUserDataKey();
@ -262,7 +263,7 @@ namespace MediaBrowser.Server.Implementations.Session
/// <returns>Task.</returns> /// <returns>Task.</returns>
/// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentNullException"></exception>
/// <exception cref="System.ArgumentOutOfRangeException">positionTicks</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) if (item == null)
{ {
@ -276,7 +277,7 @@ namespace MediaBrowser.Server.Implementations.Session
var session = Sessions.First(i => i.Id.Equals(sessionId)); var session = Sessions.First(i => i.Id.Equals(sessionId));
UpdateNowPlayingItem(session, item, isPaused, positionTicks); UpdateNowPlayingItem(session, item, isPaused, isMuted, positionTicks);
var key = item.GetUserDataKey(); var key = item.GetUserDataKey();

@ -137,8 +137,9 @@ namespace MediaBrowser.Server.Implementations.Session
} }
var isPaused = vals.Length > 2 && string.Equals(vals[2], "true", StringComparison.OrdinalIgnoreCase); 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)) else if (string.Equals(message.MessageType, "PlaybackStopped", StringComparison.OrdinalIgnoreCase))

@ -3354,7 +3354,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
* @param {String} userId * @param {String} userId
* @param {String} itemId * @param {String} itemId
*/ */
self.reportPlaybackProgress = function (userId, itemId, positionTicks, isPaused) { self.reportPlaybackProgress = function (userId, itemId, positionTicks, isPaused, isMuted) {
if (!userId) { if (!userId) {
throw new Error("null userId"); throw new Error("null userId");
@ -3368,13 +3368,17 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
var deferred = $.Deferred(); 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, []); deferred.resolveWith(null, []);
return deferred.promise(); return deferred.promise();
} }
var params = { var params = {
isPaused: isPaused,
isMuted: isMuted
}; };
if (positionTicks) { if (positionTicks) {

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <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.Common" version="3.9.58" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.58" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.58" targetFramework="net45" />
</packages> </packages>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.187</version> <version>3.0.188</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <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> <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> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <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="NLog" version="2.0.1.2" />
<dependency id="ServiceStack.Text" version="3.9.55" /> <dependency id="ServiceStack.Text" version="3.9.55" />
<dependency id="SimpleInjector" version="2.3.0" /> <dependency id="SimpleInjector" version="2.3.0" />

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.187</version> <version>3.0.188</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.187</version> <version>3.0.188</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.187" /> <dependency id="MediaBrowser.Common" version="3.0.188" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

Loading…
Cancel
Save