Don't download subtitles for magnet links (until the media file/metadata is ready at least)

This commit is contained in:
Fabio Manganiello 2019-02-19 10:37:29 +01:00
parent f71e534860
commit fd18bd84ca

View file

@ -187,7 +187,7 @@ $(document).ready(function() {
const getSubtitles = function(resource) { const getSubtitles = function(resource) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!window.config.media.subtitles) { if (!window.config.media.subtitles || resource.startsWith('magnet:?')) {
resolve(); // media.subtitles plugin not configured resolve(); // media.subtitles plugin not configured
} }
@ -440,7 +440,7 @@ $(document).ready(function() {
$mediaSubtitlesResultsContainer.show(); $mediaSubtitlesResultsContainer.show();
resolve(subs); resolve(subs);
}).catch((error) => { }).catch((error) => {
$mediaSubtitlesMessage.text('Unable to load subtitles: ' + error.message); $mediaSubtitlesMessage.text('Unable to load subtitles: ' + error);
reject(error); reject(error);
}); });
}); });