From b64259cc521c01511fb8e925e3f0190ad6ed61e7 Mon Sep 17 00:00:00 2001 From: kiriles90 <38388670+kiriles90@users.noreply.github.com> Date: Sat, 16 Jul 2022 17:37:43 +0300 Subject: [PATCH] Update torrent-list.js --- src/app/lib/views/torrent-list.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/app/lib/views/torrent-list.js b/src/app/lib/views/torrent-list.js index 2ad0052d75..be0399ff24 100644 --- a/src/app/lib/views/torrent-list.js +++ b/src/app/lib/views/torrent-list.js @@ -64,27 +64,14 @@ e.stopPropagation(); const torrent = this.getTorrent(e.target); const download = !$(e.target).hasClass('item-play'); - let imdb_id; - let subtitle; - let season; - let episode; - if (App.currentview === 'movies') { - imdb_id = App.MovieDetailView.model.get('imdb_id'); - subtitle = $("#subs-dropdown .selected-lang")[0].classList[$("#subs-dropdown .selected-lang")[0].classList.length - 1]; - } else if (App.currentview === 'shows') { - imdb_id = $('.list .items .item.selected')[0].dataset.imdbId; - season = $('.tab-episode.active')[0].attributes['data-season'].value; - episode = $('.tab-episode.active')[0].attributes['data-episode'].value; - } var torrentStart = new Backbone.Model({ torrent: torrent.url, title: this.model.get('select') && !download ? null : torrent.title, - defaultSubtitle: subtitle || Settings.subtitle_language, - imdb_id: imdb_id, - season: season, - episode: episode, - device: App.Device.Collection.selected, - // file_name: e.target.parentNode.firstChild.innerHTML + defaultSubtitle: $("#subs-dropdown .selected-lang")[0] ? $("#subs-dropdown .selected-lang")[0].classList[$("#subs-dropdown .selected-lang")[0].classList.length - 1] : Settings.subtitle_language, + imdb_id: $('.list .items .item.selected')[0] ? $('.list .items .item.selected')[0].dataset.imdbId : null, + season: $('.tab-episode.active')[0] ? $('.tab-episode.active')[0].attributes['data-season'].value : null, + episode: $('.tab-episode.active')[0] ? $('.tab-episode.active')[0].attributes['data-episode'].value : null, + device: App.Device.Collection.selected }); App.vent.trigger('stream:start', torrentStart, download ? 'downloadOnly' : '' ); if (download) {