mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
chore: check if uri exists before adding to table
This commit is contained in:
@@ -63,11 +63,22 @@ export class DownloadManager {
|
||||
userPreferences?.seedAfterDownloadCompletes &&
|
||||
this.currentDownloader === Downloader.Torrent
|
||||
) {
|
||||
await seedListRepository.save({
|
||||
downloadUri: game.uri!,
|
||||
shouldSeed: true,
|
||||
const existingSeed = await seedListRepository.findOne({
|
||||
where: { downloadUri: game.uri! }
|
||||
});
|
||||
|
||||
if (existingSeed) {
|
||||
await seedListRepository.update(
|
||||
{ downloadUri: game.uri! },
|
||||
{ shouldSeed: true }
|
||||
);
|
||||
} else {
|
||||
await seedListRepository.save({
|
||||
downloadUri: game.uri!,
|
||||
shouldSeed: true,
|
||||
});
|
||||
}
|
||||
|
||||
this.startSeedDownload(game);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user