Fixed issue with selecting files when it would filter all files out.
This commit is contained in:
parent
83f89865c9
commit
d46e6f8997
1 changed files with 9 additions and 1 deletions
|
|
@ -273,7 +273,10 @@ namespace RdtClient.Service.Services
|
|||
{
|
||||
var availableFiles = await _torrents.GetAvailableFiles(torrent.Hash);
|
||||
|
||||
files = torrent.Files.Where(m => availableFiles.Any(f => m.Path.EndsWith(f))).ToList();
|
||||
if (availableFiles.Count > 0)
|
||||
{
|
||||
files = torrent.Files.Where(m => availableFiles.Any(f => m.Path.EndsWith(f))).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
if (settingMinFileSize > 0)
|
||||
|
|
@ -281,6 +284,11 @@ namespace RdtClient.Service.Services
|
|||
files = files.Where(m => m.Bytes > settingMinFileSize).ToList();
|
||||
}
|
||||
|
||||
if (files.Count == 0)
|
||||
{
|
||||
files = torrent.Files;
|
||||
}
|
||||
|
||||
var fileIds = files.Select(m => m.Id.ToString()).ToArray();
|
||||
|
||||
await _torrents.SelectFiles(torrent.RdId, fileIds);
|
||||
|
|
|
|||
Loading…
Reference in a new issue