فهرست منبع

fixes #746 - Problems with playstate for multiple local trailers for the same movie

Luke Pulverenti 11 سال پیش
والد
کامیت
80d84225b7
1فایلهای تغییر یافته به همراه13 افزوده شده و 6 حذف شده
  1. 13 6
      MediaBrowser.Controller/Entities/Trailer.cs

+ 13 - 6
MediaBrowser.Controller/Entities/Trailer.cs

@@ -3,8 +3,9 @@ using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Runtime.Serialization;
+using System.Globalization;
 using System.Linq;
 using System.Linq;
+using System.Runtime.Serialization;
 
 
 namespace MediaBrowser.Controller.Entities
 namespace MediaBrowser.Controller.Entities
 {
 {
@@ -22,7 +23,7 @@ namespace MediaBrowser.Controller.Entities
         /// </summary>
         /// </summary>
         /// <value>The preferred metadata country code.</value>
         /// <value>The preferred metadata country code.</value>
         public string PreferredMetadataCountryCode { get; set; }
         public string PreferredMetadataCountryCode { get; set; }
-        
+
         public Trailer()
         public Trailer()
         {
         {
             RemoteTrailers = new List<MediaUrl>();
             RemoteTrailers = new List<MediaUrl>();
@@ -33,19 +34,19 @@ namespace MediaBrowser.Controller.Entities
         }
         }
 
 
         public float? Metascore { get; set; }
         public float? Metascore { get; set; }
-        
+
         public List<Guid> LocalTrailerIds { get; set; }
         public List<Guid> LocalTrailerIds { get; set; }
-        
+
         public List<MediaUrl> RemoteTrailers { get; set; }
         public List<MediaUrl> RemoteTrailers { get; set; }
 
 
         public List<string> Keywords { get; set; }
         public List<string> Keywords { get; set; }
-        
+
         /// <summary>
         /// <summary>
         /// Gets or sets the taglines.
         /// Gets or sets the taglines.
         /// </summary>
         /// </summary>
         /// <value>The taglines.</value>
         /// <value>The taglines.</value>
         public List<string> Taglines { get; set; }
         public List<string> Taglines { get; set; }
-   
+
         /// <summary>
         /// <summary>
         /// Gets or sets the budget.
         /// Gets or sets the budget.
         /// </summary>
         /// </summary>
@@ -92,6 +93,12 @@ namespace MediaBrowser.Controller.Entities
             {
             {
                 key = key + "-trailer";
                 key = key + "-trailer";
 
 
+                // Make sure different trailers have their own data.
+                if (RunTimeTicks.HasValue)
+                {
+                    key += "-" + RunTimeTicks.Value.ToString(CultureInfo.InvariantCulture);
+                }
+
                 return key;
                 return key;
             }
             }