Skip to content

Commit

Permalink
fix: dedupe infohashes
Browse files Browse the repository at this point in the history
  • Loading branch information
iPromKnight committed Nov 17, 2024
1 parent 4db3ff3 commit caa116d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private async Task ProcessBatch(List<Task<StreamedEntry>> batch, CancellationTok

var existingInfoHashes = await torrentInfoService.GetExistingInfoHashesAsync(infoHashes);

var newTorrents = torrents.Where(t => !existingInfoHashes.Contains(t.InfoHash)).ToList();
var newTorrents = torrents.DistinctBy(x => x.InfoHash).Where(t => !existingInfoHashes.Contains(t.InfoHash)).ToList();
logger.LogInformation("Filtered out {Count} torrents already in the database", torrents.Count - newTorrents.Count);

if (newTorrents.Count == 0)
Expand Down

0 comments on commit caa116d

Please sign in to comment.