Skip to content

Commit

Permalink
fix: fixing analytics for ddl
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Nov 5, 2024
1 parent 9418c4a commit b09e91a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/events/torrenting/start-game-download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b09e91a

Please sign in to comment.