update play media source feature

release-10.1.0
Luke Pulverenti 7 years ago
parent 25138bbeb7
commit 901d7b509c

@ -328,7 +328,7 @@ namespace Emby.Dlna.PlayTo
{
if (isFirst && command.StartPositionTicks.HasValue)
{
playlist.Add(CreatePlaylistItem(item, user, command.StartPositionTicks.Value, null, null, null));
playlist.Add(CreatePlaylistItem(item, user, command.StartPositionTicks.Value, command.MediaSourceId, command.AudioStreamIndex, command.SubtitleStreamIndex));
isFirst = false;
}
else

@ -27,7 +27,7 @@
"Artists": "Um\u011blci",
"Folders": "Slo\u017eky",
"Songs": "Skladby",
"TvShows": "TV Shows",
"TvShows": "TV seri\u00e1ly",
"Shows": "Seri\u00e1ly",
"Genres": "\u017d\u00e1nry",
"NameSeasonNumber": "Sez\u00f3na {0}",

@ -27,7 +27,7 @@
"Artists": "Artistes",
"Folders": "Dossiers",
"Songs": "Chansons",
"TvShows": "TV Shows",
"TvShows": "S\u00e9ries T\u00e9l\u00e9",
"Shows": "\u00c9missions",
"Genres": "Genres",
"NameSeasonNumber": "Saison {0}",

@ -1,7 +1,7 @@
{
"Latest": "Latest",
"ValueSpecialEpisodeName": "Special - {0}",
"Inherit": "Inherit",
"Latest": "Najnov\u0161ie",
"ValueSpecialEpisodeName": "\u0160peci\u00e1l - {0}",
"Inherit": "Zdedi\u0165",
"Books": "Knihy",
"Music": "Hudba",
"Games": "Hry",
@ -9,13 +9,13 @@
"MixedContent": "Zmie\u0161an\u00fd obsah",
"MusicVideos": "Hudobn\u00e9 vide\u00e1",
"HomeVideos": "Dom\u00e1ce vide\u00e1",
"Playlists": "Playlists",
"Playlists": "Zoznamy skladieb",
"HeaderRecordingGroups": "Recording Groups",
"HeaderContinueWatching": "Continue Watching",
"HeaderFavoriteArtists": "Favorite Artists",
"HeaderContinueWatching": "Pokra\u010dujte v pozeran\u00ed",
"HeaderFavoriteArtists": "Ob\u013e\u00faben\u00ed umelci",
"HeaderFavoriteSongs": "Ob\u013e\u00faben\u00e9 pesni\u010dky",
"HeaderAlbumArtists": "Album Artists",
"HeaderFavoriteAlbums": "Favorite Albums",
"HeaderFavoriteAlbums": "Ob\u013e\u00faben\u00e9 albumy",
"HeaderFavoriteEpisodes": "Ob\u013e\u00faben\u00e9 epiz\u00f3dy",
"HeaderFavoriteShows": "Ob\u013e\u00faben\u00e9 seri\u00e1ly",
"HeaderNextUp": "Nasleduje",
@ -30,62 +30,62 @@
"TvShows": "TV Shows",
"Shows": "Series",
"Genres": "\u017d\u00e1nre",
"NameSeasonNumber": "Season {0}",
"AppDeviceValues": "App: {0}, Device: {1}",
"UserDownloadingItemWithValues": "{0} is downloading {1}",
"NameSeasonNumber": "Sez\u00f3na {0}",
"AppDeviceValues": "Aplik\u00e1cia: {0}, Zariadenie: {1}",
"UserDownloadingItemWithValues": "{0} s\u0165ahuje {1}",
"HeaderLiveTV": "Live TV",
"ChapterNameValue": "Chapter {0}",
"ScheduledTaskFailedWithName": "{0} failed",
"LabelRunningTimeValue": "Running time: {0}",
"ChapterNameValue": "Kapitola {0}",
"ScheduledTaskFailedWithName": "{0} zlyhalo",
"LabelRunningTimeValue": "D\u013a\u017eka: {0}",
"ScheduledTaskStartedWithName": "{0} started",
"VersionNumber": "Version {0}",
"PluginInstalledWithName": "{0} was installed",
"StartupEmbyServerIsLoading": "Emby Server is loading. Please try again shortly.",
"PluginUpdatedWithName": "{0} was updated",
"PluginUninstalledWithName": "{0} was uninstalled",
"ItemAddedWithName": "{0} was added to the library",
"ItemRemovedWithName": "{0} was removed from the library",
"LabelIpAddressValue": "Ip address: {0}",
"DeviceOnlineWithName": "{0} is connected",
"UserOnlineFromDevice": "{0} is online from {1}",
"VersionNumber": "Verzia {0}",
"PluginInstalledWithName": "{0} bol nain\u0161talovan\u00fd",
"StartupEmbyServerIsLoading": "Emby Server sa sp\u00fa\u0161\u0165a. Sk\u00faste to pros\u00edm o chv\u00ed\u013eu znova.",
"PluginUpdatedWithName": "{0} bol aktualizovan\u00fd",
"PluginUninstalledWithName": "{0} bol odin\u0161talovan\u00fd",
"ItemAddedWithName": "{0} bol pridan\u00fd do kni\u017enice",
"ItemRemovedWithName": "{0} bol odstr\u00e1nen\u00fd z kni\u017enice",
"LabelIpAddressValue": "IP adresa: {0}",
"DeviceOnlineWithName": "{0} je pripojen\u00fd",
"UserOnlineFromDevice": "{0} je online z {1}",
"ProviderValue": "Provider: {0}",
"SubtitlesDownloadedForItem": "Subtitles downloaded for {0}",
"UserCreatedWithName": "User {0} has been created",
"UserPasswordChangedWithName": "Password has been changed for user {0}",
"UserDeletedWithName": "User {0} has been deleted",
"SubtitlesDownloadedForItem": "Titulky pre {0} stiahnut\u00e9",
"UserCreatedWithName": "Pou\u017e\u00edvate\u013e {0} bol vytvoren\u00fd",
"UserPasswordChangedWithName": "Heslo pou\u017e\u00edvate\u013ea {0} zmenen\u00e9",
"UserDeletedWithName": "Pou\u017e\u00edvate\u013e {0} bol vymazan\u00fd",
"UserConfigurationUpdatedWithName": "User configuration has been updated for {0}",
"MessageServerConfigurationUpdated": "Server configuration has been updated",
"MessageNamedServerConfigurationUpdatedWithValue": "Server configuration section {0} has been updated",
"MessageApplicationUpdated": "Emby Server has been updated",
"FailedLoginAttemptWithUserName": "Failed login attempt from {0}",
"AuthenticationSucceededWithUserName": "{0} successfully authenticated",
"UserOfflineFromDevice": "{0} has disconnected from {1}",
"DeviceOfflineWithName": "{0} has disconnected",
"UserStartedPlayingItemWithValues": "{0} has started playing {1}",
"UserStoppedPlayingItemWithValues": "{0} has stopped playing {1}",
"MessageServerConfigurationUpdated": "Konfigur\u00e1cia servera aktualizovan\u00e1",
"MessageNamedServerConfigurationUpdatedWithValue": "Sekcia {0} konfigur\u00e1cie servera bola aktualizovan\u00e1",
"MessageApplicationUpdated": "Emby Server bol aktualizovan\u00fd",
"FailedLoginAttemptWithUserName": "Ne\u00faspe\u0161n\u00fd pokus o prihl\u00e1senie z {0}",
"AuthenticationSucceededWithUserName": "{0} \u00faspe\u0161ne overen\u00fd",
"UserOfflineFromDevice": "{0} sa odpojil od {1}",
"DeviceOfflineWithName": "{0} je odpojen\u00fd",
"UserStartedPlayingItemWithValues": "{0} spustil prehr\u00e1vanie {1}",
"UserStoppedPlayingItemWithValues": "{0} zastavil prehr\u00e1vanie {1}",
"NotificationOptionPluginError": "Plugin failure",
"NotificationOptionApplicationUpdateAvailable": "Application update available",
"NotificationOptionApplicationUpdateInstalled": "Application update installed",
"NotificationOptionApplicationUpdateAvailable": "Je dostupn\u00e1 aktualiz\u00e1cia aplik\u00e1cie",
"NotificationOptionApplicationUpdateInstalled": "Aktualiz\u00e1cia aplik\u00e1cie nain\u0161talovan\u00e1",
"NotificationOptionPluginUpdateInstalled": "Plugin update installed",
"NotificationOptionPluginInstalled": "Plugin installed",
"NotificationOptionPluginUninstalled": "Plugin uninstalled",
"NotificationOptionVideoPlayback": "Video playback started",
"NotificationOptionAudioPlayback": "Audio playback started",
"NotificationOptionVideoPlayback": "Spusten\u00e9 prehr\u00e1vanie videa",
"NotificationOptionAudioPlayback": "Spusten\u00e9 prehr\u00e1vanie audia",
"NotificationOptionGamePlayback": "Game playback started",
"NotificationOptionVideoPlaybackStopped": "Video playback stopped",
"NotificationOptionAudioPlaybackStopped": "Audio playback stopped",
"NotificationOptionGamePlaybackStopped": "Game playback stopped",
"NotificationOptionTaskFailed": "Scheduled task failure",
"NotificationOptionInstallationFailed": "Installation failure",
"NotificationOptionNewLibraryContent": "New content added",
"NotificationOptionVideoPlaybackStopped": "Zastaven\u00e9 prehr\u00e1vanie videa",
"NotificationOptionAudioPlaybackStopped": "Zastaven\u00e9 prehr\u00e1vanie audia",
"NotificationOptionGamePlaybackStopped": "Hra ukon\u010den\u00e1",
"NotificationOptionTaskFailed": "Napl\u00e1novan\u00e1 \u00faloha zlyhala",
"NotificationOptionInstallationFailed": "Chyba in\u0161tal\u00e1cie",
"NotificationOptionNewLibraryContent": "Pridan\u00fd nov\u00fd obsah",
"NotificationOptionCameraImageUploaded": "Camera image uploaded",
"NotificationOptionUserLockedOut": "User locked out",
"NotificationOptionServerRestartRequired": "Server restart required",
"NotificationOptionServerRestartRequired": "Vy\u017eaduje sa re\u0161tart servera",
"UserLockedOutWithName": "User {0} has been locked out",
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
"SubtitleDownloadFailureForItem": "S\u0165ahovanie titulkov pre {0} zlyhalo",
"Sync": "Sync",
"User": "User",
"System": "System",
"User": "Pou\u017e\u00edvate\u013e",
"System": "Syst\u00e9m",
"Application": "Aplik\u00e1cia",
"Plugin": "Plugin"
}

@ -109,6 +109,18 @@ namespace Emby.Server.Implementations.Session
{
dict["StartPositionTicks"] = command.StartPositionTicks.Value.ToString(CultureInfo.InvariantCulture);
}
if (command.AudioStreamIndex.HasValue)
{
dict["AudioStreamIndex"] = command.AudioStreamIndex.Value.ToString(CultureInfo.InvariantCulture);
}
if (command.SubtitleStreamIndex.HasValue)
{
dict["SubtitleStreamIndex"] = command.SubtitleStreamIndex.Value.ToString(CultureInfo.InvariantCulture);
}
if (!string.IsNullOrWhiteSpace(command.MediaSourceId))
{
dict["MediaSourceId"] = command.MediaSourceId;
}
return SendMessage(command.PlayCommand.ToString(), dict, cancellationToken);
}

@ -972,7 +972,6 @@ namespace Emby.Server.Implementations.Session
if (command.PlayCommand == PlayCommand.PlayInstantMix)
{
items = command.ItemIds.SelectMany(i => TranslateItemForInstantMix(i, user))
.Where(i => i.LocationType != LocationType.Virtual)
.ToList();
command.PlayCommand = PlayCommand.PlayNow;
@ -986,9 +985,7 @@ namespace Emby.Server.Implementations.Session
list.AddRange(subItems);
}
items = list
.Where(i => i.LocationType != LocationType.Virtual)
.ToList();
items = list;
}
if (command.PlayCommand == PlayCommand.PlayShuffle)
@ -1074,7 +1071,8 @@ namespace Emby.Server.Implementations.Session
{
ItemFields.SortName
}
}
},
IsVirtualItem = false
});
return FilterToSingleMediaType(items)
@ -1097,7 +1095,8 @@ namespace Emby.Server.Implementations.Session
{
ItemFields.SortName
}
}
},
IsVirtualItem = false
});

@ -66,7 +66,7 @@ namespace MediaBrowser.Api.Session
[Route("/Sessions/{Id}/Playing", "POST", Summary = "Instructs a session to play an item")]
[Authenticated]
public class Play : IReturnVoid
public class Play : PlayRequest
{
/// <summary>
/// Gets or sets the id.
@ -74,27 +74,6 @@ namespace MediaBrowser.Api.Session
/// <value>The id.</value>
[ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
public string Id { get; set; }
/// <summary>
/// Artist, Genre, Studio, Person, or any kind of BaseItem
/// </summary>
/// <value>The type of the item.</value>
[ApiMember(Name = "ItemIds", Description = "The ids of the items to play, comma delimited", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST", AllowMultiple = true)]
public string ItemIds { get; set; }
/// <summary>
/// Gets or sets the start position ticks that the first item should be played at
/// </summary>
/// <value>The start position ticks.</value>
[ApiMember(Name = "StartPositionTicks", Description = "The starting position of the first item.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public long? StartPositionTicks { get; set; }
/// <summary>
/// Gets or sets the play command.
/// </summary>
/// <value>The play command.</value>
[ApiMember(Name = "PlayCommand", Description = "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public PlayCommand PlayCommand { get; set; }
}
[Route("/Sessions/{Id}/Playing/{Command}", "POST", Summary = "Issues a playstate command to a client")]
@ -471,15 +450,7 @@ namespace MediaBrowser.Api.Session
/// <param name="request">The request.</param>
public void Post(Play request)
{
var command = new PlayRequest
{
ItemIds = request.ItemIds.Split(','),
PlayCommand = request.PlayCommand,
StartPositionTicks = request.StartPositionTicks
};
var task = _sessionManager.SendPlayCommand(GetSession(_sessionContext).Result.Id, request.Id, command, CancellationToken.None);
var task = _sessionManager.SendPlayCommand(GetSession(_sessionContext).Result.Id, request.Id, request, CancellationToken.None);
Task.WaitAll(task);
}

@ -1,4 +1,5 @@

using MediaBrowser.Model.Services;
namespace MediaBrowser.Model.Session
{
/// <summary>
@ -10,18 +11,21 @@ namespace MediaBrowser.Model.Session
/// Gets or sets the item ids.
/// </summary>
/// <value>The item ids.</value>
[ApiMember(Name = "ItemIds", Description = "The ids of the items to play, comma delimited", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST", AllowMultiple = true)]
public string[] ItemIds { get; set; }
/// <summary>
/// Gets or sets the start position ticks that the first item should be played at
/// </summary>
/// <value>The start position ticks.</value>
[ApiMember(Name = "StartPositionTicks", Description = "The starting position of the first item.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "POST")]
public long? StartPositionTicks { get; set; }
/// <summary>
/// Gets or sets the play command.
/// </summary>
/// <value>The play command.</value>
[ApiMember(Name = "PlayCommand", Description = "The type of play command to issue (PlayNow, PlayNext, PlayLast). Clients who have not yet implemented play next and play last may play now.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
public PlayCommand PlayCommand { get; set; }
/// <summary>
@ -29,5 +33,9 @@ namespace MediaBrowser.Model.Session
/// </summary>
/// <value>The controlling user identifier.</value>
public string ControllingUserId { get; set; }
public int? SubtitleStreamIndex { get; set; }
public int? AudioStreamIndex { get; set; }
public string MediaSourceId { get; set; }
}
}

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.36.5")]
[assembly: AssemblyVersion("3.2.36.6")]

Loading…
Cancel
Save