Browse Source

factor device pixel ratio into downloaded image size

Luke Pulverenti 11 năm trước cách đây
mục cha
commit
1e532d4f53
24 tập tin đã thay đổi với 198 bổ sung69 xóa
  1. 5 5
      MediaBrowser.Api/Images/ImageByNameService.cs
  2. 9 1
      MediaBrowser.Api/LiveTv/LiveTvService.cs
  3. 0 5
      MediaBrowser.Controller/Channels/ChannelAudioItem.cs
  4. 0 5
      MediaBrowser.Controller/Channels/ChannelFolderItem.cs
  5. 0 5
      MediaBrowser.Controller/Channels/ChannelVideoItem.cs
  6. 16 2
      MediaBrowser.Controller/Channels/IChannel.cs
  7. 10 0
      MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs
  8. 3 0
      MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj
  9. 3 0
      MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj
  10. 24 0
      MediaBrowser.Model/ApiClient/IApiClient.cs
  11. 43 0
      MediaBrowser.Model/Channels/ChannelFeatures.cs
  12. 15 20
      MediaBrowser.Model/Channels/ChannelInfo.cs
  13. 1 0
      MediaBrowser.Model/Channels/ChannelItemQuery.cs
  14. 7 2
      MediaBrowser.Model/Configuration/ServerConfiguration.cs
  15. 12 0
      MediaBrowser.Model/LiveTv/ChannelQuery.cs
  16. 1 0
      MediaBrowser.Model/MediaBrowser.Model.csproj
  17. 5 1
      MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs
  18. 4 6
      MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
  19. 7 11
      MediaBrowser.Server.Implementations/Dto/MediaStreamSelector.cs
  20. 26 0
      MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
  21. 2 1
      MediaBrowser.Server.Implementations/Localization/Server/server.json
  22. 2 2
      Nuget/MediaBrowser.Common.Internal.nuspec
  23. 1 1
      Nuget/MediaBrowser.Common.nuspec
  24. 2 2
      Nuget/MediaBrowser.Server.Core.nuspec

+ 5 - 5
MediaBrowser.Api/Images/ImageByNameService.cs

@@ -118,20 +118,20 @@ namespace MediaBrowser.Api.Images
 
 
         public object Get(GetMediaInfoImages request)
         public object Get(GetMediaInfoImages request)
         {
         {
-            return ToOptimizedResult(GetImageList(_appPaths.MediaInfoImagesPath));
+            return ToOptimizedResult(GetImageList(_appPaths.MediaInfoImagesPath, true));
         }
         }
 
 
         public object Get(GetRatingImages request)
         public object Get(GetRatingImages request)
         {
         {
-            return ToOptimizedResult(GetImageList(_appPaths.RatingsPath));
+            return ToOptimizedResult(GetImageList(_appPaths.RatingsPath, true));
         }
         }
 
 
         public object Get(GetGeneralImages request)
         public object Get(GetGeneralImages request)
         {
         {
-            return ToOptimizedResult(GetImageList(_appPaths.GeneralPath));
+            return ToOptimizedResult(GetImageList(_appPaths.GeneralPath, false));
         }
         }
 
 
-        private List<ImageByNameInfo> GetImageList(string path)
+        private List<ImageByNameInfo> GetImageList(string path, bool supportsThemes)
         {
         {
             try
             try
             {
             {
@@ -142,7 +142,7 @@ namespace MediaBrowser.Api.Images
                     {
                     {
                         Name = Path.GetFileNameWithoutExtension(i.FullName),
                         Name = Path.GetFileNameWithoutExtension(i.FullName),
                         FileLength = i.Length,
                         FileLength = i.Length,
-                        Theme = GetThemeName(i.FullName, path),
+                        Theme = supportsThemes ? GetThemeName(i.FullName, path) : null,
                         Format = i.Extension.ToLower().TrimStart('.')
                         Format = i.Extension.ToLower().TrimStart('.')
                     })
                     })
                     .OrderBy(i => i.Name)
                     .OrderBy(i => i.Name)

+ 9 - 1
MediaBrowser.Api/LiveTv/LiveTvService.cs

@@ -42,6 +42,12 @@ namespace MediaBrowser.Api.LiveTv
 
 
         [ApiMember(Name = "IsFavorite", Description = "Filter by channels that are favorites, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
         [ApiMember(Name = "IsFavorite", Description = "Filter by channels that are favorites, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
         public bool? IsFavorite { get; set; }
         public bool? IsFavorite { get; set; }
+
+        [ApiMember(Name = "IsLiked", Description = "Filter by channels that are liked, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
+        public bool? IsLiked { get; set; }
+
+        [ApiMember(Name = "IsDisliked", Description = "Filter by channels that are disliked, or not.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
+        public bool? IsDisliked { get; set; }
     }
     }
 
 
     [Route("/LiveTv/Channels/{Id}", "GET", Summary = "Gets a live tv channel")]
     [Route("/LiveTv/Channels/{Id}", "GET", Summary = "Gets a live tv channel")]
@@ -294,7 +300,9 @@ namespace MediaBrowser.Api.LiveTv
                 UserId = request.UserId,
                 UserId = request.UserId,
                 StartIndex = request.StartIndex,
                 StartIndex = request.StartIndex,
                 Limit = request.Limit,
                 Limit = request.Limit,
-                IsFavorite = request.IsFavorite
+                IsFavorite = request.IsFavorite,
+                IsLiked = request.IsLiked,
+                IsDisliked = request.IsDisliked
 
 
             }, CancellationToken.None).Result;
             }, CancellationToken.None).Result;
 
 

+ 0 - 5
MediaBrowser.Controller/Channels/ChannelAudioItem.cs

@@ -53,10 +53,5 @@ namespace MediaBrowser.Controller.Channels
                 return base.LocationType;
                 return base.LocationType;
             }
             }
         }
         }
-
-        public override string GetClientTypeName()
-        {
-            return "audio.channelItem";
-        }
     }
     }
 }
 }

+ 0 - 5
MediaBrowser.Controller/Channels/ChannelFolderItem.cs

@@ -33,10 +33,5 @@ namespace MediaBrowser.Controller.Channels
         {
         {
             Tags = new List<string>();
             Tags = new List<string>();
         }
         }
-
-        public override string GetClientTypeName()
-        {
-            return "folder.channelItem";
-        }
     }
     }
 }
 }

+ 0 - 5
MediaBrowser.Controller/Channels/ChannelVideoItem.cs

@@ -77,10 +77,5 @@ namespace MediaBrowser.Controller.Channels
                 return base.LocationType;
                 return base.LocationType;
             }
             }
         }
         }
-
-        public override string GetClientTypeName()
-        {
-            return "video.channelItem";
-        }
     }
     }
 }
 }

+ 16 - 2
MediaBrowser.Controller/Channels/IChannel.cs

@@ -22,11 +22,17 @@ namespace MediaBrowser.Controller.Channels
         /// <value>The data version.</value>
         /// <value>The data version.</value>
         string DataVersion { get; }
         string DataVersion { get; }
 
 
+        /// <summary>
+        /// Gets the home page URL.
+        /// </summary>
+        /// <value>The home page URL.</value>
+        string HomePageUrl { get; }
+
         /// <summary>
         /// <summary>
         /// Gets the channel information.
         /// Gets the channel information.
         /// </summary>
         /// </summary>
-        /// <returns>ChannelInfo.</returns>
-        ChannelInfo GetChannelInfo();
+        /// <returns>ChannelFeatures.</returns>
+        ChannelFeatures GetChannelFeatures();
 
 
         /// <summary>
         /// <summary>
         /// Determines whether [is enabled for] [the specified user].
         /// Determines whether [is enabled for] [the specified user].
@@ -52,6 +58,14 @@ namespace MediaBrowser.Controller.Channels
         /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
         /// <returns>Task{IEnumerable{ChannelItem}}.</returns>
         Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken);
         Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken);
 
 
+        /// <summary>
+        /// Gets all media.
+        /// </summary>
+        /// <param name="query">The query.</param>
+        /// <param name="cancellationToken">The cancellation token.</param>
+        /// <returns>Task{ChannelItemResult}.</returns>
+        Task<ChannelItemResult> GetAllMedia(InternalAllChannelItemsQuery query, CancellationToken cancellationToken);
+        
         /// <summary>
         /// <summary>
         /// Gets the channel image.
         /// Gets the channel image.
         /// </summary>
         /// </summary>

+ 10 - 0
MediaBrowser.Controller/Channels/InternalChannelItemQuery.cs

@@ -12,4 +12,14 @@ namespace MediaBrowser.Controller.Channels
 
 
         public int? Limit { get; set; }
         public int? Limit { get; set; }
     }
     }
+
+    public class InternalAllChannelItemsQuery
+    {
+        public User User { get; set; }
+
+        public int? StartIndex { get; set; }
+
+        public int? Limit { get; set; }
+    }
+
 }
 }

+ 3 - 0
MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj

@@ -77,6 +77,9 @@
     <Compile Include="..\MediaBrowser.Model\ApiClient\SessionUpdatesEventArgs.cs">
     <Compile Include="..\MediaBrowser.Model\ApiClient\SessionUpdatesEventArgs.cs">
       <Link>ApiClient\SessionUpdatesEventArgs.cs</Link>
       <Link>ApiClient\SessionUpdatesEventArgs.cs</Link>
     </Compile>
     </Compile>
+    <Compile Include="..\MediaBrowser.Model\Channels\ChannelFeatures.cs">
+      <Link>Channels\ChannelFeatures.cs</Link>
+    </Compile>
     <Compile Include="..\MediaBrowser.Model\Channels\ChannelInfo.cs">
     <Compile Include="..\MediaBrowser.Model\Channels\ChannelInfo.cs">
       <Link>Channels\ChannelInfo.cs</Link>
       <Link>Channels\ChannelInfo.cs</Link>
     </Compile>
     </Compile>

+ 3 - 0
MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj

@@ -64,6 +64,9 @@
     <Compile Include="..\MediaBrowser.Model\ApiClient\SessionUpdatesEventArgs.cs">
     <Compile Include="..\MediaBrowser.Model\ApiClient\SessionUpdatesEventArgs.cs">
       <Link>ApiClient\SessionUpdatesEventArgs.cs</Link>
       <Link>ApiClient\SessionUpdatesEventArgs.cs</Link>
     </Compile>
     </Compile>
+    <Compile Include="..\MediaBrowser.Model\Channels\ChannelFeatures.cs">
+      <Link>Channels\ChannelFeatures.cs</Link>
+    </Compile>
     <Compile Include="..\MediaBrowser.Model\Channels\ChannelInfo.cs">
     <Compile Include="..\MediaBrowser.Model\Channels\ChannelInfo.cs">
       <Link>Channels\ChannelInfo.cs</Link>
       <Link>Channels\ChannelInfo.cs</Link>
     </Compile>
     </Compile>

+ 24 - 0
MediaBrowser.Model/ApiClient/IApiClient.cs

@@ -59,6 +59,30 @@ namespace MediaBrowser.Model.ApiClient
         Task<T> GetAsync<T>(string url, CancellationToken cancellationToken)
         Task<T> GetAsync<T>(string url, CancellationToken cancellationToken)
             where T : class;
             where T : class;
 
 
+        /// <summary>
+        /// Gets the url needed to stream an audio file
+        /// </summary>
+        /// <param name="options">The options.</param>
+        /// <returns>System.String.</returns>
+        /// <exception cref="ArgumentNullException">options</exception>
+        string GetAudioStreamUrl(StreamOptions options);
+
+        /// <summary>
+        /// Gets the url needed to stream a video file
+        /// </summary>
+        /// <param name="options">The options.</param>
+        /// <returns>System.String.</returns>
+        /// <exception cref="ArgumentNullException">options</exception>
+        string GetVideoStreamUrl(VideoStreamOptions options);
+
+        /// <summary>
+        /// Formulates a url for streaming video using the HLS protocol
+        /// </summary>
+        /// <param name="options">The options.</param>
+        /// <returns>System.String.</returns>
+        /// <exception cref="ArgumentNullException">options</exception>
+        string GetHlsVideoStreamUrl(VideoStreamOptions options);
+
         /// <summary>
         /// <summary>
         /// Reports the capabilities.
         /// Reports the capabilities.
         /// </summary>
         /// </summary>

+ 43 - 0
MediaBrowser.Model/Channels/ChannelFeatures.cs

@@ -0,0 +1,43 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.Channels
+{
+    public class ChannelFeatures
+    {
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance can search.
+        /// </summary>
+        /// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value>
+        public bool CanSearch { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance can index all media.
+        /// </summary>
+        /// <value><c>true</c> if this instance can index all media; otherwise, <c>false</c>.</value>
+        public bool CanGetAllMedia { get; set; }
+        
+        /// <summary>
+        /// Gets or sets the media types.
+        /// </summary>
+        /// <value>The media types.</value>
+        public List<ChannelMediaType> MediaTypes { get; set; }
+
+        /// <summary>
+        /// Gets or sets the content types.
+        /// </summary>
+        /// <value>The content types.</value>
+        public List<ChannelMediaContentType> ContentTypes { get; set; }
+
+        /// <summary>
+        /// Represents the maximum number of records the channel allows retrieving at a time
+        /// </summary>
+        public int? MaxPageSize { get; set; }
+
+        public ChannelFeatures()
+        {
+            MediaTypes = new List<ChannelMediaType>();
+            ContentTypes = new List<ChannelMediaContentType>();
+        }
+    }
+
+}

+ 15 - 20
MediaBrowser.Model/Channels/ChannelInfo.cs

@@ -1,35 +1,30 @@
-using System.Collections.Generic;
-
+
 namespace MediaBrowser.Model.Channels
 namespace MediaBrowser.Model.Channels
 {
 {
     public class ChannelInfo
     public class ChannelInfo
     {
     {
         /// <summary>
         /// <summary>
-        /// Gets the home page URL.
+        /// Gets or sets the name.
         /// </summary>
         /// </summary>
-        /// <value>The home page URL.</value>
-        public string HomePageUrl { get; set; }
+        /// <value>The name.</value>
+        public string Name { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// Gets or sets a value indicating whether this instance can search.
+        /// Gets or sets the identifier.
         /// </summary>
         /// </summary>
-        /// <value><c>true</c> if this instance can search; otherwise, <c>false</c>.</value>
-        public bool CanSearch { get; set; }
-
-        public List<ChannelMediaType> MediaTypes { get; set; }
-
-        public List<ChannelMediaContentType> ContentTypes { get; set; }
+        /// <value>The identifier.</value>
+        public string Id { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// Represents the maximum number of records the channel allows retrieving at a time
+        /// Gets or sets the home page URL.
         /// </summary>
         /// </summary>
-        public int? MaxPageSize { get; set; }
+        /// <value>The home page URL.</value>
+        public string HomePageUrl { get; set; }
 
 
-        public ChannelInfo()
-        {
-            MediaTypes = new List<ChannelMediaType>();
-            ContentTypes = new List<ChannelMediaContentType>();
-        }
+        /// <summary>
+        /// Gets or sets the features.
+        /// </summary>
+        /// <value>The features.</value>
+        public ChannelFeatures Features { get; set; }
     }
     }
-
 }
 }

+ 1 - 0
MediaBrowser.Model/Channels/ChannelItemQuery.cs

@@ -45,4 +45,5 @@ namespace MediaBrowser.Model.Channels
             SortBy = new string[] { };
             SortBy = new string[] { };
         }
         }
     }
     }
+
 }
 }

+ 7 - 2
MediaBrowser.Model/Configuration/ServerConfiguration.cs

@@ -170,8 +170,8 @@ namespace MediaBrowser.Model.Configuration
         public bool EnableTmdbUpdates { get; set; }
         public bool EnableTmdbUpdates { get; set; }
         public bool EnableFanArtUpdates { get; set; }
         public bool EnableFanArtUpdates { get; set; }
 
 
-        public bool RequireManualLoginForMobileApps { get; set; }
-        public bool RequireManualLoginForOtherApps { get; set; }
+        public bool RequireMobileManualLogin { get; set; }
+        public bool RequireNonMobileManualLogin { get; set; }
 
 
         /// <summary>
         /// <summary>
         /// Gets or sets the image saving convention.
         /// Gets or sets the image saving convention.
@@ -223,6 +223,9 @@ namespace MediaBrowser.Model.Configuration
 
 
         public SubtitleOptions SubtitleOptions { get; set; }
         public SubtitleOptions SubtitleOptions { get; set; }
 
 
+        [Obsolete]
+        public string[] ManualLoginClients { get; set; }
+
         /// <summary>
         /// <summary>
         /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
         /// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
         /// </summary>
         /// </summary>
@@ -263,6 +266,8 @@ namespace MediaBrowser.Model.Configuration
             SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };
             SortRemoveCharacters = new[] { ",", "&", "-", "{", "}", "'" };
             SortRemoveWords = new[] { "the", "a", "an" };
             SortRemoveWords = new[] { "the", "a", "an" };
 
 
+            ManualLoginClients = new string[] { };
+
             SeasonZeroDisplayName = "Specials";
             SeasonZeroDisplayName = "Specials";
 
 
             LiveTvOptions = new LiveTvOptions();
             LiveTvOptions = new LiveTvOptions();

+ 12 - 0
MediaBrowser.Model/LiveTv/ChannelQuery.cs

@@ -17,6 +17,18 @@ namespace MediaBrowser.Model.LiveTv
         /// </summary>
         /// </summary>
         /// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
         /// <value><c>null</c> if [is favorite] contains no value, <c>true</c> if [is favorite]; otherwise, <c>false</c>.</value>
         public bool? IsFavorite { get; set; }
         public bool? IsFavorite { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is liked.
+        /// </summary>
+        /// <value><c>null</c> if [is liked] contains no value, <c>true</c> if [is liked]; otherwise, <c>false</c>.</value>
+        public bool? IsLiked { get; set; }
+
+        /// <summary>
+        /// Gets or sets a value indicating whether this instance is disliked.
+        /// </summary>
+        /// <value><c>null</c> if [is disliked] contains no value, <c>true</c> if [is disliked]; otherwise, <c>false</c>.</value>
+        public bool? IsDisliked { get; set; }
         
         
         /// <summary>
         /// <summary>
         /// Gets or sets the user identifier.
         /// Gets or sets the user identifier.

+ 1 - 0
MediaBrowser.Model/MediaBrowser.Model.csproj

@@ -59,6 +59,7 @@
     <Compile Include="ApiClient\IServerEvents.cs" />
     <Compile Include="ApiClient\IServerEvents.cs" />
     <Compile Include="ApiClient\GeneralCommandEventArgs.cs" />
     <Compile Include="ApiClient\GeneralCommandEventArgs.cs" />
     <Compile Include="ApiClient\SessionUpdatesEventArgs.cs" />
     <Compile Include="ApiClient\SessionUpdatesEventArgs.cs" />
+    <Compile Include="Channels\ChannelFeatures.cs" />
     <Compile Include="Channels\ChannelInfo.cs" />
     <Compile Include="Channels\ChannelInfo.cs" />
     <Compile Include="Channels\ChannelItemQuery.cs" />
     <Compile Include="Channels\ChannelItemQuery.cs" />
     <Compile Include="Channels\ChannelMediaContentType.cs" />
     <Compile Include="Channels\ChannelMediaContentType.cs" />

+ 5 - 1
MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs

@@ -609,10 +609,14 @@ namespace MediaBrowser.Providers.TV
                 var roles = nameGroup.Count() > 1 ? nameGroup[1].Trim() : null;
                 var roles = nameGroup.Count() > 1 ? nameGroup[1].Trim() : null;
                 if (roles != null)
                 if (roles != null)
                     roles = roles.EndsWith(")") ? roles.Substring(0, roles.Length - 1) : roles;
                     roles = roles.EndsWith(")") ? roles.Substring(0, roles.Length - 1) : roles;
+
                 return new PersonInfo { Type = PersonType.GuestStar, Name = name, Role = roles };
                 return new PersonInfo { Type = PersonType.GuestStar, Name = name, Role = roles };
             }))
             }))
             {
             {
-                item.AddPerson(person);
+                if (!string.IsNullOrWhiteSpace(person.Name))
+                {
+                    item.AddPerson(person);
+                }
             }
             }
         }
         }
 
 

+ 4 - 6
MediaBrowser.Server.Implementations/Channels/ChannelManager.cs

@@ -215,9 +215,7 @@ namespace MediaBrowser.Server.Implementations.Channels
                 isNew = true;
                 isNew = true;
             }
             }
 
 
-            var info = channelInfo.GetChannelInfo();
-
-            item.HomePageUrl = info.HomePageUrl;
+            item.HomePageUrl = channelInfo.HomePageUrl;
             item.OriginalChannelName = channelInfo.Name;
             item.OriginalChannelName = channelInfo.Name;
 
 
             if (string.IsNullOrEmpty(item.Name))
             if (string.IsNullOrEmpty(item.Name))
@@ -258,7 +256,7 @@ namespace MediaBrowser.Server.Implementations.Channels
             // Find the corresponding channel provider plugin
             // Find the corresponding channel provider plugin
             var channelProvider = GetChannelProvider(channel);
             var channelProvider = GetChannelProvider(channel);
 
 
-            var channelInfo = channelProvider.GetChannelInfo();
+            var channelInfo = channelProvider.GetChannelFeatures();
 
 
             int? providerStartIndex = null;
             int? providerStartIndex = null;
             int? providerLimit = null;
             int? providerLimit = null;
@@ -448,7 +446,7 @@ namespace MediaBrowser.Server.Implementations.Channels
         {
         {
             // Increment this as needed to force new downloads
             // Increment this as needed to force new downloads
             // Incorporate Name because it's being used to convert channel entity to provider
             // Incorporate Name because it's being used to convert channel entity to provider
-            return externalId + (channelProvider.DataVersion ?? string.Empty) + (channelProvider.Name ?? string.Empty) + "12";
+            return externalId + (channelProvider.DataVersion ?? string.Empty) + (channelProvider.Name ?? string.Empty) + "13";
         }
         }
 
 
         private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, IChannel channelProvider, Channel internalChannel, CancellationToken cancellationToken)
         private async Task<BaseItem> GetChannelItemEntity(ChannelItemInfo info, IChannel channelProvider, Channel internalChannel, CancellationToken cancellationToken)
@@ -473,7 +471,7 @@ namespace MediaBrowser.Server.Implementations.Channels
             }
             }
             else if (info.MediaType == ChannelMediaType.Audio)
             else if (info.MediaType == ChannelMediaType.Audio)
             {
             {
-                id = idToHash.GetMBId(typeof(ChannelFolderItem));
+                id = idToHash.GetMBId(typeof(ChannelAudioItem));
 
 
                 item = _libraryManager.GetItemById(id) as ChannelAudioItem;
                 item = _libraryManager.GetItemById(id) as ChannelAudioItem;
 
 

+ 7 - 11
MediaBrowser.Server.Implementations/Dto/MediaStreamSelector.cs

@@ -64,7 +64,7 @@ namespace MediaBrowser.Server.Implementations.Dto
                 // always load the most suitable full subtitles
                 // always load the most suitable full subtitles
                 stream = full.FirstOrDefault();
                 stream = full.FirstOrDefault();
             }
             }
-            
+
             // load forced subs if we have found no suitable full subtitles
             // load forced subs if we have found no suitable full subtitles
             stream = stream ?? forced.FirstOrDefault();
             stream = stream ?? forced.FirstOrDefault();
 
 
@@ -86,17 +86,13 @@ namespace MediaBrowser.Server.Implementations.Dto
             var orderStreams = streams
             var orderStreams = streams
                 .Where(i => i.Type == type);
                 .Where(i => i.Type == type);
 
 
-            if (languagePreferences.Count == 0)
-            {
-                return orderStreams.OrderBy(i => i.IsDefault)
-                    .ThenBy(i => i.Index)
-                    .ToList();
-            }
-
+            // Give some preferance to external text subs for better performance
             return orderStreams.OrderBy(i => languagePreferences.FindIndex(l => string.Equals(i.Language, l, StringComparison.OrdinalIgnoreCase)))
             return orderStreams.OrderBy(i => languagePreferences.FindIndex(l => string.Equals(i.Language, l, StringComparison.OrdinalIgnoreCase)))
-                .ThenBy(i => i.IsDefault)
-                .ThenBy(i => i.Index)
-                .ToList();
+                 .ThenBy(i => i.IsDefault)
+                 .ThenBy(i => !i.IsGraphicalSubtitleStream)
+                 .ThenBy(i => i.IsExternal)
+                 .ThenBy(i => i.Index)
+                 .ToList();
         }
         }
     }
     }
 }
 }

+ 26 - 0
MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs

@@ -150,6 +150,32 @@ namespace MediaBrowser.Server.Implementations.LiveTv
                     channels = channels
                     channels = channels
                         .Where(i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite == val);
                         .Where(i => _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).IsFavorite == val);
                 }
                 }
+
+                if (query.IsLiked.HasValue)
+                {
+                    var val = query.IsLiked.Value;
+
+                    channels = channels
+                        .Where(i =>
+                        {
+                            var likes = _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).Likes;
+
+                            return likes.HasValue && likes.Value == val;
+                        });
+                }
+
+                if (query.IsDisliked.HasValue)
+                {
+                    var val = query.IsDisliked.Value;
+
+                    channels = channels
+                        .Where(i =>
+                        {
+                            var likes = _userDataManager.GetUserData(user.Id, i.GetUserDataKey()).Likes;
+
+                            return likes.HasValue && likes.Value != val;
+                        });
+                }
             }
             }
 
 
             channels = channels.OrderBy(i =>
             channels = channels.OrderBy(i =>

+ 2 - 1
MediaBrowser.Server.Implementations/Localization/Server/server.json

@@ -785,5 +785,6 @@
 	"HeaderLiveTv": "Live TV",
 	"HeaderLiveTv": "Live TV",
 	"HeaderReports": "Reports",
 	"HeaderReports": "Reports",
 	"HeaderMetadataManager": "Metadata Manager",
 	"HeaderMetadataManager": "Metadata Manager",
-	"HeaderPreferences": "Preferences"
+	"HeaderPreferences": "Preferences",
+	"MessageLoadingChannels": "Loading channel content..."
 }
 }

+ 2 - 2
Nuget/MediaBrowser.Common.Internal.nuspec

@@ -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.374</version>
+        <version>3.0.378</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.374" />
+            <dependency id="MediaBrowser.Common" version="3.0.378" />
             <dependency id="NLog" version="2.1.0" />
             <dependency id="NLog" version="2.1.0" />
             <dependency id="SimpleInjector" version="2.5.0" />
             <dependency id="SimpleInjector" version="2.5.0" />
             <dependency id="sharpcompress" version="0.10.2" />
             <dependency id="sharpcompress" version="0.10.2" />

+ 1 - 1
Nuget/MediaBrowser.Common.nuspec

@@ -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.374</version>
+        <version>3.0.378</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 - 2
Nuget/MediaBrowser.Server.Core.nuspec

@@ -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.374</version>
+        <version>3.0.378</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.374" />
+            <dependency id="MediaBrowser.Common" version="3.0.378" />
         </dependencies>
         </dependencies>
     </metadata>
     </metadata>
     <files>
     <files>