This commit is contained in:
Tommy Mikkelsen 2022-09-04 23:25:26 +02:00
parent 667b75409c
commit 0c0298a402
2 changed files with 6 additions and 1 deletions

View file

@ -128,6 +128,7 @@ ipcMain.on('downloadFile', function (event, data) {
axios({
method: 'GET',
url: item,
headers: data.header,
responseType: 'stream',
httpsAgent: agent
}).then((response) => {

View file

@ -1163,6 +1163,9 @@ const etHelper = new class ETHELPER {
}
async forceDownload( { url: url, target: target, title: title } ) {
let header = wtutils.PMSHeader;
header['X-Plex-Token'] = store.getters.getSelectedServer.accessToken;
const _this = this;
return new Promise((resolve) => {
try
@ -1170,7 +1173,8 @@ const etHelper = new class ETHELPER {
_this.isDownloading = true;
ipcRenderer.send('downloadFile', {
item: url,
filePath: target
filePath: target,
header: header
})
}
catch (error)