mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 05:24:55 +03:00
fix: seeding causing python process to crash
This commit is contained in:
parent
e1a1136e05
commit
89bfb517fb
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydralauncher",
|
"name": "hydralauncher",
|
||||||
"version": "3.1.1",
|
"version": "3.1.2",
|
||||||
"description": "Hydra",
|
"description": "Hydra",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "Los Broxas",
|
"author": "Los Broxas",
|
||||||
|
@ -27,18 +27,27 @@ if start_download_payload:
|
|||||||
if initial_download['url'].startswith('magnet'):
|
if initial_download['url'].startswith('magnet'):
|
||||||
torrent_downloader = TorrentDownloader(torrent_session)
|
torrent_downloader = TorrentDownloader(torrent_session)
|
||||||
downloads[initial_download['game_id']] = torrent_downloader
|
downloads[initial_download['game_id']] = torrent_downloader
|
||||||
|
try:
|
||||||
torrent_downloader.start_download(initial_download['url'], initial_download['save_path'], "")
|
torrent_downloader.start_download(initial_download['url'], initial_download['save_path'], "")
|
||||||
|
except Exception as e:
|
||||||
|
print("Error starting torrent download", e)
|
||||||
else:
|
else:
|
||||||
http_downloader = HttpDownloader()
|
http_downloader = HttpDownloader()
|
||||||
downloads[initial_download['game_id']] = http_downloader
|
downloads[initial_download['game_id']] = http_downloader
|
||||||
|
try:
|
||||||
http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'))
|
http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'))
|
||||||
|
except Exception as e:
|
||||||
|
print("Error starting http download", e)
|
||||||
|
|
||||||
if start_seeding_payload:
|
if start_seeding_payload:
|
||||||
initial_seeding = json.loads(urllib.parse.unquote(start_seeding_payload))
|
initial_seeding = json.loads(urllib.parse.unquote(start_seeding_payload))
|
||||||
for seed in initial_seeding:
|
for seed in initial_seeding:
|
||||||
torrent_downloader = TorrentDownloader(torrent_session, lt.torrent_flags.upload_mode)
|
torrent_downloader = TorrentDownloader(torrent_session, lt.torrent_flags.upload_mode)
|
||||||
downloads[seed['game_id']] = torrent_downloader
|
downloads[seed['game_id']] = torrent_downloader
|
||||||
|
try:
|
||||||
torrent_downloader.start_download(seed['url'], seed['save_path'], "")
|
torrent_downloader.start_download(seed['url'], seed['save_path'], "")
|
||||||
|
except Exception as e:
|
||||||
|
print("Error starting seeding", e)
|
||||||
|
|
||||||
def validate_rpc_password():
|
def validate_rpc_password():
|
||||||
"""Middleware to validate RPC password."""
|
"""Middleware to validate RPC password."""
|
||||||
|
@ -10,6 +10,7 @@ import { HydraApi } from "./services/hydra-api";
|
|||||||
import { uploadGamesBatch } from "./services/library-sync";
|
import { uploadGamesBatch } from "./services/library-sync";
|
||||||
import { Aria2 } from "./services/aria2";
|
import { Aria2 } from "./services/aria2";
|
||||||
import { Downloader } from "@shared";
|
import { Downloader } from "@shared";
|
||||||
|
import { IsNull, Not } from "typeorm";
|
||||||
|
|
||||||
const loadState = async (userPreferences: UserPreferences | null) => {
|
const loadState = async (userPreferences: UserPreferences | null) => {
|
||||||
import("./events");
|
import("./events");
|
||||||
@ -40,6 +41,7 @@ const loadState = async (userPreferences: UserPreferences | null) => {
|
|||||||
shouldSeed: true,
|
shouldSeed: true,
|
||||||
downloader: Downloader.Torrent,
|
downloader: Downloader.Torrent,
|
||||||
progress: 1,
|
progress: 1,
|
||||||
|
uri: Not(IsNull()),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user