forked from platypush/platypush
Only proceed with subtitles loading when the list of subs is not empty
This commit is contained in:
parent
4076cd3518
commit
a21a11d499
1 changed files with 2 additions and 2 deletions
|
@ -339,7 +339,7 @@ $(document).ready(function() {
|
||||||
if (subtitlesConf) {
|
if (subtitlesConf) {
|
||||||
populateSubtitlesModal(resource).then((subs) => {
|
populateSubtitlesModal(resource).then((subs) => {
|
||||||
if ('language' in subtitlesConf) {
|
if ('language' in subtitlesConf) {
|
||||||
if (subs) {
|
if (subs && sub.length) {
|
||||||
downloadSubtitles(subs[0].SubDownloadLink, resource).then((subtitles) => {
|
downloadSubtitles(subs[0].SubDownloadLink, resource).then((subtitles) => {
|
||||||
_play(resource, subtitles).finally(onVideoReady);
|
_play(resource, subtitles).finally(onVideoReady);
|
||||||
resolve(resource, subtitles);
|
resolve(resource, subtitles);
|
||||||
|
@ -398,7 +398,7 @@ $(document).ready(function() {
|
||||||
$mediaSubtitlesResultsContainer.hide();
|
$mediaSubtitlesResultsContainer.hide();
|
||||||
|
|
||||||
getSubtitles(resource).then((subs) => {
|
getSubtitles(resource).then((subs) => {
|
||||||
if (!subs) {
|
if (!subs || !subs.length) {
|
||||||
$mediaSubtitlesMessage.text('No subtitles found');
|
$mediaSubtitlesMessage.text('No subtitles found');
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue