Merge pull request #955 from ploughpuff/avoid

Avoid exceptions due to folder and file not found
pull/981/head
Vasily 6 years ago committed by GitHub
commit 785fa76ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,12 +43,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
var jsonFile = path + ".json";
try
if (!File.Exists(jsonFile))
{
return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile) ?? new List<T>();
return new List<T>();
}
catch (FileNotFoundException)
try
{
return _jsonSerializer.DeserializeFromFile<List<T>>(jsonFile) ?? new List<T>();
}
catch (IOException)
{
@ -57,6 +59,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
Logger.LogError(ex, "Error deserializing {jsonFile}", jsonFile);
}
return new List<T>();
}

@ -170,7 +170,7 @@ namespace MediaBrowser.Api
/// </summary>
private void DeleteEncodedMediaCache()
{
var path = _config.ApplicationPaths.TranscodingTempPath;
var path = _config.ApplicationPaths.GetTranscodingTempPath();
foreach (var file in _fileSystem.GetFilePaths(path, true))
{

Loading…
Cancel
Save