mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-08 10:44:23 -04:00
Merge pull request #955 from ploughpuff/avoid
Avoid exceptions due to folder and file not found
This commit is contained in:
commit
785fa76ac6
@ -43,13 +43,15 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
{
|
{
|
||||||
var jsonFile = path + ".json";
|
var jsonFile = path + ".json";
|
||||||
|
|
||||||
|
if (!File.Exists(jsonFile))
|
||||||
|
{
|
||||||
|
return new List<T>();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile) ?? new List<T>();
|
return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile) ?? new List<T>();
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
catch (IOException)
|
catch (IOException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -57,6 +59,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
{
|
{
|
||||||
Logger.LogError(ex, "Error deserializing {jsonFile}", jsonFile);
|
Logger.LogError(ex, "Error deserializing {jsonFile}", jsonFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new List<T>();
|
return new List<T>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ namespace MediaBrowser.Api
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void DeleteEncodedMediaCache()
|
private void DeleteEncodedMediaCache()
|
||||||
{
|
{
|
||||||
var path = _config.ApplicationPaths.TranscodingTempPath;
|
var path = _config.ApplicationPaths.GetTranscodingTempPath();
|
||||||
|
|
||||||
foreach (var file in _fileSystem.GetFilePaths(path, true))
|
foreach (var file in _fileSystem.GetFilePaths(path, true))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user