Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Fixes saving a .torrent file #8246

Merged
merged 1 commit into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/browser/webtorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ipc = electron.ipcMain
const appUrlUtil = require('../../js/lib/appUrlUtil')
const messages = require('../../js/constants/messages')
const Filtering = require('../filtering')
const url = require('url')

// Set to see communication between WebTorrent and torrent viewer tabs
const DEBUG_IPC = false
Expand Down Expand Up @@ -60,7 +61,13 @@ function setupFiltering () {
return {}
}

var viewerUrl = getViewerURL(details.url)
const parsedUrl = url.parse(details.url)
const directDownload = parsedUrl && parsedUrl.query && parsedUrl.query.includes('download=true')
if (directDownload) {
return {}
}

const viewerUrl = getViewerURL(details.url)

return {
responseHeaders: {
Expand Down
1 change: 1 addition & 0 deletions js/webtorrent/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ function saveTorrentFile () {
let a = document.createElement('a')
a.target = '_blank'
a.download = true
a.href = `${store.torrentId}?download=true`
a.href = store.torrentId
a.click()
}
Expand Down