mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
updates static resourceprovider with better logging.
This commit is contained in:
parent
6fc8ec6cbc
commit
43b4262e14
3 changed files with 12 additions and 13 deletions
|
@ -35,20 +35,20 @@ namespace NzbDrone.Api.Frontend
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var requestMapper in _requestMappers)
|
var mapper = _requestMappers.SingleOrDefault(m => m.CanHandle(path));
|
||||||
{
|
|
||||||
if (requestMapper.CanHandle(path))
|
|
||||||
{
|
|
||||||
var filePath = requestMapper.Map(path);
|
|
||||||
|
|
||||||
if (_diskProvider.FileExists(filePath))
|
if (mapper != null)
|
||||||
{
|
{
|
||||||
return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
|
var filePath = mapper.Map(path);
|
||||||
}
|
|
||||||
|
if (_diskProvider.FileExists(filePath))
|
||||||
|
{
|
||||||
|
return new StreamResponse(() => File.OpenRead(filePath), MimeTypes.GetMimeType(filePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_logger.Warn("File {0} not found", filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Warn("Couldn't find a matching file for: {0}", path);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,6 +81,8 @@ namespace NzbDrone.Core.Update
|
||||||
var process = _processProvider.Start(startInfo);
|
var process = _processProvider.Start(startInfo);
|
||||||
|
|
||||||
_processProvider.WaitForExit(process);
|
_processProvider.WaitForExit(process);
|
||||||
|
|
||||||
|
_logger.Error("Update process failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Dictionary<DateTime, string> GetUpdateLogFiles()
|
public Dictionary<DateTime, string> GetUpdateLogFiles()
|
||||||
|
|
|
@ -81,9 +81,6 @@ namespace NzbDrone.Update.Providers
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder);
|
_diskProvider.CopyDirectory(_environmentProvider.GetUpdatePackageFolder(), targetFolder);
|
||||||
|
|
||||||
logger.Trace("Deleting Update Package.");
|
|
||||||
_diskProvider.DeleteFolder(_environmentProvider.GetUpdatePackageFolder(), true);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue