trying to account for cross-seed

This commit is contained in:
Flaminel
2025-02-21 23:22:21 +02:00
parent f91e85651f
commit 19ac8cbd28
4 changed files with 78 additions and 11 deletions
@@ -300,6 +300,17 @@ public class QBitService : DownloadService, IQBitService
public override async Task ChangeCategoryForNoHardlinksAsync(List<object> downloads, HashSet<string> excludedHashes)
{
if (_downloadCleanerConfig.IgnoreRootDir)
{
// TODO call this only if Unix
downloads
.Cast<TorrentInfo>()
.GroupBy(x => x.SavePath)
.Select(x => x.Key)
.ToList()
.ForEach(x => _hardlinkFileService.PopulateInodeCounts(x));
}
// TODO account for cross-seed
foreach (TorrentInfo download in downloads)
{
@@ -332,7 +343,7 @@ public class QBitService : DownloadService, IQBitService
: download.SavePath, file.Name
);
ulong hardlinkCount = _hardlinkFileService.GetHardLinkCount(filePath);
ulong hardlinkCount = _hardlinkFileService.GetHardLinkCount(filePath, _downloadCleanerConfig.IgnoreRootDir);
if (hardlinkCount is 0)
{