瀏覽代碼

add slideshows to now playing page

Luke Pulverenti 9 年之前
父節點
當前提交
918aa4cfd7

+ 19 - 4
MediaBrowser.Server.Implementations/LiveTv/Listings/SchedulesDirect.cs

@@ -1,9 +1,11 @@
-using MediaBrowser.Common;
+using System.Net;
+using MediaBrowser.Common;
 using MediaBrowser.Common.Net;
 using MediaBrowser.Common.Net;
 using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.LiveTv;
 using MediaBrowser.Model.LiveTv;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Net;
 using MediaBrowser.Model.Serialization;
 using MediaBrowser.Model.Serialization;
 using System;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Concurrent;
@@ -620,11 +622,24 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
 
 
             options.RequestHeaders["token"] = token;
             options.RequestHeaders["token"] = token;
 
 
-            using (var response = await _httpClient.Get(options).ConfigureAwait(false))
+            try
+            {
+                using (var response = await _httpClient.Get(options).ConfigureAwait(false))
+                {
+                    var root = _jsonSerializer.DeserializeFromStream<ScheduleDirect.Lineups>(response);
+
+                    return root.lineups.Any(i => string.Equals(info.ListingsId, i.lineup, StringComparison.OrdinalIgnoreCase));
+                }
+            }
+            catch (HttpException ex)
             {
             {
-                var root = _jsonSerializer.DeserializeFromStream<ScheduleDirect.Lineups>(response);
+                // Apparently we're supposed to swallow this
+                if (ex.StatusCode.HasValue && ex.StatusCode.Value == HttpStatusCode.BadRequest)
+                {
+                    return false;
+                }
 
 
-                return root.lineups.Any(i => string.Equals(info.ListingsId, i.lineup, StringComparison.OrdinalIgnoreCase));
+                throw;
             }
             }
         }
         }
 
 

+ 3 - 0
MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj

@@ -261,6 +261,9 @@
     <Content Include="dashboard-ui\scripts\sharingwidget.js">
     <Content Include="dashboard-ui\scripts\sharingwidget.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
+    <Content Include="dashboard-ui\scripts\slideshow.js">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="dashboard-ui\scripts\wizardlivetvtuner.js">
     <Content Include="dashboard-ui\scripts\wizardlivetvtuner.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>