feat: adding level generic interface

This commit is contained in:
Chubby Granny Chaser
2025-11-29 02:19:41 +00:00
parent f41128c4c8
commit 140718764d
18 changed files with 36 additions and 24 deletions

View File

@@ -13,7 +13,9 @@ export class SystemPath {
};
static checkIfPathsAreAvailable() {
const paths = Object.keys(SystemPath.paths) as (keyof typeof SystemPath.paths)[];
const paths = Object.keys(
SystemPath.paths
) as (keyof typeof SystemPath.paths)[];
paths.forEach((pathName) => {
try {

View File

@@ -1,4 +1,8 @@
import { TorrentDownloader, TorrentSession, TorrentStatus } from "./hydra-native";
import {
TorrentDownloader,
TorrentSession,
TorrentStatus,
} from "./hydra-native";
import { logger } from "./logger";
// Global torrent session - matches Python's torrent_session
@@ -44,7 +48,10 @@ export class TorrentDownloadService {
torrentDownloaders.set(downloadId, downloader);
return downloader;
} catch (error) {
logger.error(`Failed to create torrent downloader for ${downloadId}`, error);
logger.error(
`Failed to create torrent downloader for ${downloadId}`,
error
);
return null;
}
}
@@ -95,7 +102,10 @@ export class TorrentDownloadService {
logger.log(`Cancelled torrent download for ${downloadId}`);
}
} catch (error) {
logger.error(`Failed to cancel torrent download for ${downloadId}`, error);
logger.error(
`Failed to cancel torrent download for ${downloadId}`,
error
);
throw error;
}
}
@@ -110,9 +120,11 @@ export class TorrentDownloadService {
const status = downloader.getDownloadStatus();
return status || null;
} catch (error) {
logger.error(`Failed to get torrent download status for ${downloadId}`, error);
logger.error(
`Failed to get torrent download status for ${downloadId}`,
error
);
return null;
}
}
}