mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
@@ -215,23 +215,32 @@ namespace Jackett.Updater
|
|||||||
|
|
||||||
logger.Info("Finding files in: " + updateLocation);
|
logger.Info("Finding files in: " + updateLocation);
|
||||||
var files = Directory.GetFiles(updateLocation, "*.*", SearchOption.AllDirectories).OrderBy(x => x).ToList();
|
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();
|
foreach (var file in files)
|
||||||
|
|
||||||
if (fileName.EndsWith(".zip") || fileName.EndsWith(".tar") || fileName.EndsWith(".gz"))
|
|
||||||
{
|
{
|
||||||
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)
|
bool fileCopySuccess = CopyUpdateFile(options.Path, file, updateLocation, false);
|
||||||
{
|
|
||||||
//Perform second attempt, this time removing the target file first
|
if (!fileCopySuccess)
|
||||||
CopyUpdateFile(options.Path, file, updateLocation, true);
|
{
|
||||||
|
//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");
|
logger.Info("File copying complete");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user