- acc.push({
- type: 'Link',
- mediaType: 'application/x-bittorrent' as 'application/x-bittorrent',
- href: model.getTorrentUrl(file, baseUrlHttp),
- height: file.resolution
- })
-
- acc.push({
- type: 'Link',
- mediaType: 'application/x-bittorrent;x-scheme-handler/magnet' as 'application/x-bittorrent;x-scheme-handler/magnet',
- href: generateMagnetUri(model, file, baseUrlHttp, baseUrlWs),
- height: file.resolution
- })
+ if (file.hasTorrent()) {
+ acc.push({
+ type: 'Link',
+ mediaType: 'application/x-bittorrent' as 'application/x-bittorrent',
+ href: file.getTorrentUrl(),
+ height: file.resolution
+ })
+
+ acc.push({
+ type: 'Link',
+ mediaType: 'application/x-bittorrent;x-scheme-handler/magnet' as 'application/x-bittorrent;x-scheme-handler/magnet',
+ href: generateMagnetUri(video, file, trackerUrls),
+ height: file.resolution
+ })
+ }