Skip to content

Commit b09e91a

Browse files
fix: fixing analytics for ddl
1 parent 9418c4a commit b09e91a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/events/torrenting/start-game-download.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ const startGameDownload = async (
9191
logger.error("Failed to create game download", err);
9292
});
9393

94-
const { infoHash } = await parseTorrent(payload.uri);
95-
if (infoHash) {
96-
HydraAnalytics.postDownload(infoHash).catch(() => {});
94+
if (uri.startsWith("magnet:")) {
95+
try {
96+
const { infoHash } = await parseTorrent(payload.uri);
97+
if (infoHash) {
98+
HydraAnalytics.postDownload(infoHash).catch(() => {});
99+
}
100+
} catch (err) {
101+
logger.error("Failed to parse torrent", err);
102+
}
97103
}
98104

99105
await DownloadManager.cancelDownload(updatedGame!.id);

0 commit comments

Comments
 (0)