Browse Source

Added UserId To API Remotecontrol-calls

7illusions 11 năm trước cách đây
mục cha
commit
b7b8cb5084

+ 45 - 2
MediaBrowser.Api/SessionsService.cs

@@ -46,6 +46,14 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         public Guid Id { get; set; }
 
+        /// <summary>
+        /// Gets or sets the UserId.
+        /// </summary>
+        /// <value>The id.</value>
+        [ApiMember(Name = "UserId", Description = "The controlling User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "POST")]
+        public Guid UserId { get; set; }
+        //TODO IsRequired = false shall be changed to true once the clients has been updated and the new ApiClient is in use
+
         /// <summary>
         /// Artist, Genre, Studio, Person, or any kind of BaseItem
         /// </summary>
@@ -88,6 +96,14 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         public Guid Id { get; set; }
 
+        /// <summary>
+        /// Gets or sets the UserId.
+        /// </summary>
+        /// <value>The id.</value>
+        [ApiMember(Name = "UserId", Description = "The controlling User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "POST")]
+        public Guid UserId { get; set; }
+        //TODO IsRequired = false shall be changed to true once the clients has been updated and the new ApiClient is in use
+
         /// <summary>
         /// Artist, Genre, Studio, Person, or any kind of BaseItem
         /// </summary>
@@ -121,6 +137,14 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         public Guid Id { get; set; }
 
+        /// <summary>
+        /// Gets or sets the UserId.
+        /// </summary>
+        /// <value>The id.</value>
+        [ApiMember(Name = "UserId", Description = "The controlling User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "POST")]
+        public Guid UserId { get; set; }
+        //TODO IsRequired = false shall be changed to true once the clients has been updated and the new ApiClient is in use
+
         /// <summary>
         /// Gets or sets the position to seek to
         /// </summary>
@@ -146,6 +170,14 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         public Guid Id { get; set; }
 
+        /// <summary>
+        /// Gets or sets the UserId.
+        /// </summary>
+        /// <value>The id.</value>
+        [ApiMember(Name = "UserId", Description = "The controlling User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "POST")]
+        public Guid UserId { get; set; }
+        //TODO IsRequired = false shall be changed to true once the clients has been updated and the new ApiClient is in use
+
         /// <summary>
         /// Gets or sets the command.
         /// </summary>
@@ -165,6 +197,14 @@ namespace MediaBrowser.Api
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         public Guid Id { get; set; }
 
+        /// <summary>
+        /// Gets or sets the UserId.
+        /// </summary>
+        /// <value>The id.</value>
+        [ApiMember(Name = "UserId", Description = "The controlling User Id", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "POST")]
+        public Guid UserId { get; set; }
+        //TODO IsRequired = false shall be changed to true once the clients has been updated and the new ApiClient is in use
+
         [ApiMember(Name = "Text", Description = "The message text.", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "POST")]
         public string Text { get; set; }
 
@@ -270,9 +310,10 @@ namespace MediaBrowser.Api
         }
 
         public void Post(SendPlaystateCommand request)
-        {
+        {            
             var command = new PlaystateRequest
             {
+                UserId = request.UserId,
                 Command = request.Command,
                 SeekPositionTicks = request.SeekPositionTicks
             };
@@ -290,6 +331,7 @@ namespace MediaBrowser.Api
         {
             var command = new BrowseRequest
             {
+                UserId = request.UserId,
                 Context = request.Context,
                 ItemId = request.ItemId,
                 ItemName = request.ItemName,
@@ -321,6 +363,7 @@ namespace MediaBrowser.Api
             var command = new MessageCommand
             {
                 Header = string.IsNullOrEmpty(request.Header) ? "Message from Server" : request.Header,
+                UserId = request.UserId,
                 TimeoutMs = request.TimeoutMs,
                 Text = request.Text
             };
@@ -339,7 +382,7 @@ namespace MediaBrowser.Api
             var command = new PlayRequest
             {
                 ItemIds = request.ItemIds.Split(',').ToArray(),
-
+                UserId = request.UserId,
                 PlayCommand = request.PlayCommand,
                 StartPositionTicks = request.StartPositionTicks
             };

+ 6 - 1
MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj

@@ -11,12 +11,17 @@
     <RootNamespace>MediaBrowser.Model</RootNamespace>
     <AssemblyName>MediaBrowser.Model</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <TargetFrameworkProfile>Profile104</TargetFrameworkProfile>
+    <TargetFrameworkProfile>Profile158</TargetFrameworkProfile>
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
     <RestorePackages>true</RestorePackages>
     <FodyPath>..\packages\Fody.1.19.1.0</FodyPath>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>4.0</OldToolsVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>

+ 4 - 0
MediaBrowser.Model/Session/BrowseRequest.cs

@@ -1,4 +1,6 @@
 
+using System;
+
 namespace MediaBrowser.Model.Session
 {
     /// <summary>
@@ -12,6 +14,8 @@ namespace MediaBrowser.Model.Session
         /// <value>The type of the item.</value>
         public string ItemType { get; set; }
 
+        public Guid UserId { get; set; }
+
         /// <summary>
         /// Gets or sets the item id.
         /// </summary>

+ 4 - 1
MediaBrowser.Model/Session/MessageCommand.cs

@@ -1,8 +1,11 @@
 
+using System;
 namespace MediaBrowser.Model.Session
 {
     public class MessageCommand
-    {
+    {       
+        public Guid UserId { get; set; }
+
         public string Header { get; set; }
         
         public string Text { get; set; }

+ 12 - 0
MediaBrowser.Model/Session/PlayRequest.cs

@@ -1,4 +1,5 @@
 
+using System;
 namespace MediaBrowser.Model.Session
 {
     /// <summary>
@@ -6,6 +7,11 @@ namespace MediaBrowser.Model.Session
     /// </summary>
     public class PlayRequest
     {
+        public PlayRequest()
+        {
+
+        }
+
         /// <summary>
         /// Gets or sets the item ids.
         /// </summary>
@@ -23,6 +29,12 @@ namespace MediaBrowser.Model.Session
         /// </summary>
         /// <value>The play command.</value>
         public PlayCommand PlayCommand { get; set; }
+
+        /// <summary>
+        /// Gets or sets the play command.
+        /// </summary>
+        /// <value>The play command.</value>
+        public Guid UserId { get; set; }
     }
 
     /// <summary>

+ 3 - 0
MediaBrowser.Model/Session/PlaystateCommand.cs

@@ -1,4 +1,5 @@
 
+using System;
 namespace MediaBrowser.Model.Session
 {
     /// <summary>
@@ -34,6 +35,8 @@ namespace MediaBrowser.Model.Session
 
     public class PlaystateRequest
     {
+        public Guid UserId { get; set; }
+
         public PlaystateCommand Command { get; set; }
 
         public long? SeekPositionTicks { get; set; }