fix: fixing analytics for ddl
Some checks are pending
Release / build (ubuntu-latest) (push) Waiting to run
Release / build (windows-latest) (push) Waiting to run

This commit is contained in:
Chubby Granny Chaser 2024-11-05 20:29:44 +00:00
parent 9418c4acf7
commit b09e91a1cf
No known key found for this signature in database

View file

@ -91,9 +91,15 @@ const startGameDownload = async (
logger.error("Failed to create game download", err);
});
const { infoHash } = await parseTorrent(payload.uri);
if (infoHash) {
HydraAnalytics.postDownload(infoHash).catch(() => {});
if (uri.startsWith("magnet:")) {
try {
const { infoHash } = await parseTorrent(payload.uri);
if (infoHash) {
HydraAnalytics.postDownload(infoHash).catch(() => {});
}
} catch (err) {
logger.error("Failed to parse torrent", err);
}
}
await DownloadManager.cancelDownload(updatedGame!.id);