mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 22:07:13 -04:00
add error handling to recording parsing
This commit is contained in:
parent
24fcde7d91
commit
146547b02e
@ -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 };
|
||||||
|
|
||||||
|
@ -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)))
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user