fixed qbit file path

This commit is contained in:
Flaminel
2025-02-21 15:41:48 +02:00
parent 1650b0e5a4
commit d454a094a0
2 changed files with 13 additions and 2 deletions
@@ -327,7 +327,12 @@ public class QBitService : DownloadService, IQBitService
return;
}
ulong hardlinkCount = _hardlinkFileService.GetHardLinkCount(file.Name);
string filePath = Path.Combine(Directory.Exists(download.ContentPath)
? download.ContentPath
: download.SavePath, file.Name
);
ulong hardlinkCount = _hardlinkFileService.GetHardLinkCount(filePath);
if (hardlinkCount is 0)
{
@@ -339,7 +344,7 @@ public class QBitService : DownloadService, IQBitService
if (hardlinkCount > 1)
{
hasHardlinks = true;
};
}
}
if (hasHardlinks)
@@ -15,6 +15,12 @@ public class HardlinkFileService : IHardlinkFileService
public ulong GetHardLinkCount(string filePath)
{
if (!File.Exists(filePath))
{
_logger.LogDebug("file {file} does not exist", filePath);
return default;
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return GetWindowsHardLinkCount(filePath);