Merge pull request #7625 from crobibero/xml-cache-delete

This commit is contained in:
Cody Robibero 2022-04-20 17:37:44 -06:00 committed by GitHub
commit ec6f7bdcff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -79,7 +79,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
return UnzipIfNeeded(info.Path, cacheFile);
}
File.Delete(cacheFile);
// Must check if file exists as parent directory may not exist.
if (File.Exists(cacheFile))
{
File.Delete(cacheFile);
}
_logger.LogInformation("Downloading xmltv listings from {Path}", info.Path);
Directory.CreateDirectory(Path.GetDirectoryName(cacheFile));