mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
chore: check if uri exists before adding to table
This commit is contained in:
parent
92ec056ba8
commit
1ad501c64e
1 changed files with 14 additions and 3 deletions
|
@ -63,11 +63,22 @@ export class DownloadManager {
|
||||||
userPreferences?.seedAfterDownloadCompletes &&
|
userPreferences?.seedAfterDownloadCompletes &&
|
||||||
this.currentDownloader === Downloader.Torrent
|
this.currentDownloader === Downloader.Torrent
|
||||||
) {
|
) {
|
||||||
await seedListRepository.save({
|
const existingSeed = await seedListRepository.findOne({
|
||||||
downloadUri: game.uri!,
|
where: { downloadUri: game.uri! }
|
||||||
shouldSeed: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (existingSeed) {
|
||||||
|
await seedListRepository.update(
|
||||||
|
{ downloadUri: game.uri! },
|
||||||
|
{ shouldSeed: true }
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
await seedListRepository.save({
|
||||||
|
downloadUri: game.uri!,
|
||||||
|
shouldSeed: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.startSeedDownload(game);
|
this.startSeedDownload(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue