mirror of
https://github.com/Jackett/Jackett
synced 2025-02-23 23:00:51 +00:00
parent
6f65992bb5
commit
3530fa8244
1 changed files with 20 additions and 11 deletions
|
@ -215,23 +215,32 @@ namespace Jackett.Updater
|
|||
|
||||
logger.Info("Finding files in: " + updateLocation);
|
||||
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories).OrderBy(x => x).ToList();
|
||||
foreach (var file in files)
|
||||
logger.Info($"{files.Count()} update files found");
|
||||
|
||||
try
|
||||
{
|
||||
var fileName = Path.GetFileName(file).ToLowerInvariant();
|
||||
|
||||
if (fileName.EndsWith(".zip") || fileName.EndsWith(".tar") || fileName.EndsWith(".gz"))
|
||||
foreach (var file in files)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var fileName = Path.GetFileName(file).ToLowerInvariant();
|
||||
|
||||
bool fileCopySuccess = CopyUpdateFile(options.Path, file, updateLocation, false);
|
||||
if (fileName.EndsWith(".zip") || fileName.EndsWith(".tar") || fileName.EndsWith(".gz"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!fileCopySuccess)
|
||||
{
|
||||
//Perform second attempt, this time removing the target file first
|
||||
CopyUpdateFile(options.Path, file, updateLocation, true);
|
||||
bool fileCopySuccess = CopyUpdateFile(options.Path, file, updateLocation, false);
|
||||
|
||||
if (!fileCopySuccess)
|
||||
{
|
||||
//Perform second attempt, this time removing the target file first
|
||||
CopyUpdateFile(options.Path, file, updateLocation, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex);
|
||||
}
|
||||
|
||||
logger.Info("File copying complete");
|
||||
|
||||
|
|
Loading…
Reference in a new issue