mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-22 21:50:36 +02:00
added generic remote control commands
This commit is contained in:
parent
1dafb46b71
commit
57623886b2
|
@ -12,8 +12,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class UpdateDisplayPreferences
|
/// Class UpdateDisplayPreferences
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/DisplayPreferences/{DisplayPreferencesId}", "POST")]
|
[Route("/DisplayPreferences/{DisplayPreferencesId}", "POST", Summary = "Updates a user's display preferences for an item")]
|
||||||
[Api(("Updates a user's display preferences for an item"))]
|
|
||||||
public class UpdateDisplayPreferences : DisplayPreferences, IReturnVoid
|
public class UpdateDisplayPreferences : DisplayPreferences, IReturnVoid
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -30,8 +29,7 @@ namespace MediaBrowser.Api
|
||||||
public string Client { get; set; }
|
public string Client { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/DisplayPreferences/{Id}", "GET")]
|
[Route("/DisplayPreferences/{Id}", "GET", Summary = "Gets a user's display preferences for an item")]
|
||||||
[Api(("Gets a user's display preferences for an item"))]
|
|
||||||
public class GetDisplayPreferences : IReturn<DisplayPreferences>
|
public class GetDisplayPreferences : IReturn<DisplayPreferences>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -13,8 +13,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetDirectoryContents
|
/// Class GetDirectoryContents
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Environment/DirectoryContents", "GET")]
|
[Route("/Environment/DirectoryContents", "GET", Summary = "Gets the contents of a given directory in the file system")]
|
||||||
[Api(Description = "Gets the contents of a given directory in the file system")]
|
|
||||||
public class GetDirectoryContents : IReturn<List<FileSystemEntryInfo>>
|
public class GetDirectoryContents : IReturn<List<FileSystemEntryInfo>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -46,8 +45,7 @@ namespace MediaBrowser.Api
|
||||||
public bool IncludeHidden { get; set; }
|
public bool IncludeHidden { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/Environment/NetworkShares", "GET")]
|
[Route("/Environment/NetworkShares", "GET", Summary = "Gets shares from a network device")]
|
||||||
[Api(Description = "Gets shares from a network device")]
|
|
||||||
public class GetNetworkShares : IReturn<List<FileSystemEntryInfo>>
|
public class GetNetworkShares : IReturn<List<FileSystemEntryInfo>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -61,8 +59,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetDrives
|
/// Class GetDrives
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Environment/Drives", "GET")]
|
[Route("/Environment/Drives", "GET", Summary = "Gets available drives from the server's file system")]
|
||||||
[Api(Description = "Gets available drives from the server's file system")]
|
|
||||||
public class GetDrives : IReturn<List<FileSystemEntryInfo>>
|
public class GetDrives : IReturn<List<FileSystemEntryInfo>>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -70,14 +67,12 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetNetworkComputers
|
/// Class GetNetworkComputers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Environment/NetworkDevices", "GET")]
|
[Route("/Environment/NetworkDevices", "GET", Summary = "Gets a list of devices on the network")]
|
||||||
[Api(Description = "Gets a list of devices on the network")]
|
|
||||||
public class GetNetworkDevices : IReturn<List<FileSystemEntryInfo>>
|
public class GetNetworkDevices : IReturn<List<FileSystemEntryInfo>>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/Environment/ParentPath", "GET")]
|
[Route("/Environment/ParentPath", "GET", Summary = "Gets the parent path of a given path")]
|
||||||
[Api(Description = "Gets the parent path of a given path")]
|
|
||||||
public class GetParentPath : IReturn<string>
|
public class GetParentPath : IReturn<string>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using System.Globalization;
|
using MediaBrowser.Controller.Dto;
|
||||||
using MediaBrowser.Controller.Dto;
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Persistence;
|
using MediaBrowser.Controller.Persistence;
|
||||||
|
@ -7,6 +6,7 @@ using MediaBrowser.Model.Dto;
|
||||||
using ServiceStack;
|
using ServiceStack;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
@ -15,8 +15,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetSimilarGames
|
/// Class GetSimilarGames
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Games/{Id}/Similar", "GET")]
|
[Route("/Games/{Id}/Similar", "GET", Summary = "Finds games similar to a given game.")]
|
||||||
[Api(Description = "Finds games similar to a given game.")]
|
|
||||||
public class GetSimilarGames : BaseGetSimilarItemsFromItem
|
public class GetSimilarGames : BaseGetSimilarItemsFromItem
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -24,8 +23,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetGameSystemSummaries
|
/// Class GetGameSystemSummaries
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Games/SystemSummaries", "GET")]
|
[Route("/Games/SystemSummaries", "GET", Summary = "Finds games similar to a given game.")]
|
||||||
[Api(Description = "Finds games similar to a given game.")]
|
|
||||||
public class GetGameSystemSummaries : IReturn<List<GameSystemSummary>>
|
public class GetGameSystemSummaries : IReturn<List<GameSystemSummary>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -39,8 +37,7 @@ namespace MediaBrowser.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetGameSystemSummaries
|
/// Class GetGameSystemSummaries
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Games/PlayerIndex", "GET")]
|
[Route("/Games/PlayerIndex", "GET", Summary = "Gets an index of players (1-x) and the number of games listed under each")]
|
||||||
[Api(Description = "Gets an index of players (1-x) and the number of games listed under each")]
|
|
||||||
public class GetPlayerIndex : IReturn<List<ItemIndex>>
|
public class GetPlayerIndex : IReturn<List<ItemIndex>>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -17,23 +17,22 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetAudioStream
|
/// Class GetAudioStream
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Audio/{Id}/stream.mp3", "GET")]
|
[Route("/Audio/{Id}/stream.mp3", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.wma", "GET")]
|
[Route("/Audio/{Id}/stream.wma", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.aac", "GET")]
|
[Route("/Audio/{Id}/stream.aac", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.flac", "GET")]
|
[Route("/Audio/{Id}/stream.flac", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.ogg", "GET")]
|
[Route("/Audio/{Id}/stream.ogg", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.oga", "GET")]
|
[Route("/Audio/{Id}/stream.oga", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.webm", "GET")]
|
[Route("/Audio/{Id}/stream.webm", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream", "GET")]
|
[Route("/Audio/{Id}/stream", "GET", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.mp3", "HEAD")]
|
[Route("/Audio/{Id}/stream.mp3", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.wma", "HEAD")]
|
[Route("/Audio/{Id}/stream.wma", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.aac", "HEAD")]
|
[Route("/Audio/{Id}/stream.aac", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.flac", "HEAD")]
|
[Route("/Audio/{Id}/stream.flac", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.ogg", "HEAD")]
|
[Route("/Audio/{Id}/stream.ogg", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.oga", "HEAD")]
|
[Route("/Audio/{Id}/stream.oga", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream.webm", "HEAD")]
|
[Route("/Audio/{Id}/stream.webm", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Route("/Audio/{Id}/stream", "HEAD")]
|
[Route("/Audio/{Id}/stream", "HEAD", Summary = "Gets an audio stream")]
|
||||||
[Api(Description = "Gets an audio stream")]
|
|
||||||
public class GetAudioStream : StreamRequest
|
public class GetAudioStream : StreamRequest
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -44,7 +43,8 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AudioService : BaseProgressiveStreamingService
|
public class AudioService : BaseProgressiveStreamingService
|
||||||
{
|
{
|
||||||
public AudioService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IDtoService dtoService, IFileSystem fileSystem, IItemRepository itemRepository, ILiveTvManager liveTvManager, IEncodingManager encodingManager, IDlnaManager dlnaManager, IHttpClient httpClient, IImageProcessor imageProcessor) : base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, dtoService, fileSystem, itemRepository, liveTvManager, encodingManager, dlnaManager, httpClient, imageProcessor)
|
public AudioService(IServerConfigurationManager serverConfig, IUserManager userManager, ILibraryManager libraryManager, IIsoManager isoManager, IMediaEncoder mediaEncoder, IDtoService dtoService, IFileSystem fileSystem, IItemRepository itemRepository, ILiveTvManager liveTvManager, IEncodingManager encodingManager, IDlnaManager dlnaManager, IHttpClient httpClient, IImageProcessor imageProcessor)
|
||||||
|
: base(serverConfig, userManager, libraryManager, isoManager, mediaEncoder, dtoService, fileSystem, itemRepository, liveTvManager, encodingManager, dlnaManager, httpClient, imageProcessor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,8 @@ namespace MediaBrowser.Api.UserLibrary
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetItems
|
/// Class GetItems
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Items", "GET")]
|
[Route("/Items", "GET", Summary = "Gets items based on a query.")]
|
||||||
[Route("/Users/{UserId}/Items", "GET")]
|
[Route("/Users/{UserId}/Items", "GET", Summary = "Gets items based on a query.")]
|
||||||
[Api(Description = "Gets items based on a query.")]
|
|
||||||
public class GetItems : BaseItemsRequest, IReturn<ItemsResult>
|
public class GetItems : BaseItemsRequest, IReturn<ItemsResult>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -3,7 +3,6 @@ using MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Serialization;
|
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Dlna
|
namespace MediaBrowser.Controller.Dlna
|
||||||
|
|
|
@ -18,6 +18,9 @@ namespace MediaBrowser.Controller.Dlna
|
||||||
[XmlAttribute("audioCodec")]
|
[XmlAttribute("audioCodec")]
|
||||||
public string AudioCodec { get; set; }
|
public string AudioCodec { get; set; }
|
||||||
|
|
||||||
|
[XmlAttribute("protocol")]
|
||||||
|
public string Protocol { get; set; }
|
||||||
|
|
||||||
[XmlAttribute("estimateContentLength")]
|
[XmlAttribute("estimateContentLength")]
|
||||||
public bool EstimateContentLength { get; set; }
|
public bool EstimateContentLength { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,14 @@ namespace MediaBrowser.Controller.Session
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken);
|
Task SendPlaystateCommand(PlaystateRequest command, CancellationToken cancellationToken);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sends the generic command.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="command">The command.</param>
|
||||||
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
|
/// <returns>Task.</returns>
|
||||||
|
Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends the library update info.
|
/// Sends the library update info.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -619,5 +619,10 @@ namespace MediaBrowser.Dlna.PlayTo
|
||||||
_logger.Log(LogSeverity.Debug, "Controller disposed");
|
_logger.Log(LogSeverity.Debug, "Controller disposed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -428,6 +428,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\Session\BrowseRequest.cs">
|
<Compile Include="..\MediaBrowser.Model\Session\BrowseRequest.cs">
|
||||||
<Link>Session\BrowseRequest.cs</Link>
|
<Link>Session\BrowseRequest.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Session\GenericCommand.cs">
|
||||||
|
<Link>Session\GenericCommand.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Session\MessageCommand.cs">
|
<Compile Include="..\MediaBrowser.Model\Session\MessageCommand.cs">
|
||||||
<Link>Session\MessageCommand.cs</Link>
|
<Link>Session\MessageCommand.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -415,6 +415,9 @@
|
||||||
<Compile Include="..\MediaBrowser.Model\Session\BrowseRequest.cs">
|
<Compile Include="..\MediaBrowser.Model\Session\BrowseRequest.cs">
|
||||||
<Link>Session\BrowseRequest.cs</Link>
|
<Link>Session\BrowseRequest.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="..\MediaBrowser.Model\Session\GenericCommand.cs">
|
||||||
|
<Link>Session\GenericCommand.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\MediaBrowser.Model\Session\MessageCommand.cs">
|
<Compile Include="..\MediaBrowser.Model\Session\MessageCommand.cs">
|
||||||
<Link>Session\MessageCommand.cs</Link>
|
<Link>Session\MessageCommand.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -132,6 +132,7 @@
|
||||||
<Compile Include="Querying\UserQuery.cs" />
|
<Compile Include="Querying\UserQuery.cs" />
|
||||||
<Compile Include="Search\SearchQuery.cs" />
|
<Compile Include="Search\SearchQuery.cs" />
|
||||||
<Compile Include="Session\BrowseRequest.cs" />
|
<Compile Include="Session\BrowseRequest.cs" />
|
||||||
|
<Compile Include="Session\GenericCommand.cs" />
|
||||||
<Compile Include="Session\MessageCommand.cs" />
|
<Compile Include="Session\MessageCommand.cs" />
|
||||||
<Compile Include="Session\PlaybackReports.cs" />
|
<Compile Include="Session\PlaybackReports.cs" />
|
||||||
<Compile Include="Session\PlayRequest.cs" />
|
<Compile Include="Session\PlayRequest.cs" />
|
||||||
|
|
43
MediaBrowser.Model/Session/GenericCommand.cs
Normal file
43
MediaBrowser.Model/Session/GenericCommand.cs
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace MediaBrowser.Model.Session
|
||||||
|
{
|
||||||
|
public class GenericCommand
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public Dictionary<string, string> Arguments { get; set; }
|
||||||
|
|
||||||
|
public GenericCommand()
|
||||||
|
{
|
||||||
|
Arguments = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum CoreGenericCommand
|
||||||
|
{
|
||||||
|
MoveUp = 0,
|
||||||
|
MoveDown = 1,
|
||||||
|
MoveLeft = 2,
|
||||||
|
MoveRight = 3,
|
||||||
|
PageUp = 4,
|
||||||
|
PageDown = 5,
|
||||||
|
PreviousLetter = 6,
|
||||||
|
NextLetter = 7,
|
||||||
|
ToggleOsd = 8,
|
||||||
|
ToggleContextMenu = 9,
|
||||||
|
Select = 10,
|
||||||
|
Back = 11,
|
||||||
|
TakeScreenshot = 12,
|
||||||
|
SendKey = 13,
|
||||||
|
SendString = 14,
|
||||||
|
GoHome = 15,
|
||||||
|
GoToSettings = 16,
|
||||||
|
VolumeUp = 17,
|
||||||
|
VolumeDown = 18,
|
||||||
|
Mute = 19,
|
||||||
|
Unmute = 20,
|
||||||
|
ToggleMute = 21
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,7 +33,15 @@ namespace MediaBrowser.Model.Session
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The fullscreen
|
/// The fullscreen
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Fullscreen
|
Fullscreen,
|
||||||
|
/// <summary>
|
||||||
|
/// The rewind
|
||||||
|
/// </summary>
|
||||||
|
Rewind,
|
||||||
|
/// <summary>
|
||||||
|
/// The fast forward
|
||||||
|
/// </summary>
|
||||||
|
FastForward
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PlaystateRequest
|
public class PlaystateRequest
|
||||||
|
|
|
@ -146,5 +146,16 @@ namespace MediaBrowser.Server.Implementations.Roku
|
||||||
RequestContentType = "application/json"
|
RequestContentType = "application/json"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return SendCommand(new WebSocketMessage<GenericCommand>
|
||||||
|
{
|
||||||
|
MessageType = "Command",
|
||||||
|
Data = command
|
||||||
|
|
||||||
|
}, cancellationToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,5 +198,17 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||||
|
|
||||||
}, cancellationToken);
|
}, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task SendGenericCommand(GenericCommand command, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var socket = GetActiveSocket();
|
||||||
|
|
||||||
|
return socket.SendAsync(new WebSocketMessage<GenericCommand>
|
||||||
|
{
|
||||||
|
MessageType = "Command",
|
||||||
|
Data = command
|
||||||
|
|
||||||
|
}, cancellationToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue