Browse Source

add error handling to recording parsing

Luke Pulverenti 9 years ago
parent
commit
146547b02e

+ 1 - 1
MediaBrowser.Api/TvShowsService.cs

@@ -273,7 +273,7 @@ namespace MediaBrowser.Api
         {
         {
             var user = _userManager.GetUserById(request.UserId);
             var user = _userManager.GetUserById(request.UserId);
 
 
-            var minPremiereDate = DateTime.Now.Date.AddDays(-1).ToUniversalTime();
+            var minPremiereDate = DateTime.Now.Date.ToUniversalTime();
 
 
             var parentIds = string.IsNullOrWhiteSpace(request.ParentId) ? new string[] { } : new[] { request.ParentId };
             var parentIds = string.IsNullOrWhiteSpace(request.ParentId) ? new string[] { } : new[] { request.ParentId };
 
 

+ 16 - 1
MediaBrowser.Server.Implementations/LiveTv/EmbyTV/ItemDataProvider.cs

@@ -47,7 +47,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
 
             try
             try
             {
             {
-                return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile);
+                return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile) ?? new List<T>();
             }
             }
             catch (FileNotFoundException)
             catch (FileNotFoundException)
             {
             {
@@ -69,6 +69,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
 
         private void UpdateList(List<T> newList)
         private void UpdateList(List<T> newList)
         {
         {
+            if (newList == null)
+            {
+                throw new ArgumentNullException("newList");
+            }
+
             var file = _dataPath + ".json";
             var file = _dataPath + ".json";
             _fileSystem.CreateDirectory(Path.GetDirectoryName(file));
             _fileSystem.CreateDirectory(Path.GetDirectoryName(file));
 
 
@@ -81,6 +86,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
 
         public virtual void Update(T item)
         public virtual void Update(T item)
         {
         {
+            if (item == null)
+            {
+                throw new ArgumentNullException("item");
+            }
+
             var list = GetAll().ToList();
             var list = GetAll().ToList();
 
 
             var index = list.FindIndex(i => EqualityComparer(i, item));
             var index = list.FindIndex(i => EqualityComparer(i, item));
@@ -97,6 +107,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
 
 
         public virtual void Add(T item)
         public virtual void Add(T item)
         {
         {
+            if (item == null)
+            {
+                throw new ArgumentNullException("item");
+            }
+
             var list = GetAll().ToList();
             var list = GetAll().ToList();
 
 
             if (list.Any(i => EqualityComparer(i, item)))
             if (list.Any(i => EqualityComparer(i, item)))

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

@@ -341,9 +341,6 @@
     <Content Include="dashboard-ui\components\sharingwidget.js">
     <Content Include="dashboard-ui\components\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\supporterkeypage.js">
     <Content Include="dashboard-ui\scripts\supporterkeypage.js">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>