add episode setting

This commit is contained in:
Luke Pulverenti 2016-02-25 08:36:24 -05:00
parent 91cedefe29
commit 97de2542b7
5 changed files with 38 additions and 32 deletions

View File

@ -83,9 +83,10 @@
<label for="selectMaxChromecastBitrate" class="selectLabel">${LabelMaxChromecastBitrate}</label>
<select id="selectMaxChromecastBitrate" data-mini="true"></select>
</div>
<div class="fldExternalPlayer" style="display: none;">
<br />
<div style="margin-top:2em;">
<paper-checkbox class="chkEpisodeAutoPlay">${OptionPlayNextEpisodeAutomatically}</paper-checkbox>
</div>
<div class="fldExternalPlayer" style="margin-top:2em;display: none;">
<paper-checkbox class="chkExternalVideoPlayer">${OptionEnableExternalVideoPlayers}</paper-checkbox>
<div class="fieldDescription paperCheckboxFieldDescription">
<div style="display:none;" class="labelGenericExternalPlayers">${LabelExternalPlayersHelp}</div>

View File

@ -514,46 +514,47 @@
}
else if (smart && firstItem.Type == "Episode" && items.length == 1) {
promise = ApiClient.getEpisodes(firstItem.SeriesId, {
IsVirtualUnaired: false,
IsMissing: false,
UserId: ApiClient.getCurrentUserId(),
Fields: getItemFields
promise = ApiClient.getCurrentUser().then(function(user) {
if (!user.Configuration.EnableEpisodeAutoQueue) {
return null;
}
}).then(function (episodesResult) {
return ApiClient.getEpisodes(firstItem.SeriesId, {
IsVirtualUnaired: false,
IsMissing: false,
UserId: ApiClient.getCurrentUserId(),
Fields: getItemFields
var foundItem = false;
episodesResult.Items = episodesResult.Items.filter(function (e) {
}).then(function (episodesResult) {
if (foundItem) {
return true;
}
if (e.Id == firstItem.Id) {
foundItem = true;
return true;
}
var foundItem = false;
episodesResult.Items = episodesResult.Items.filter(function (e) {
return false;
if (foundItem) {
return true;
}
if (e.Id == firstItem.Id) {
foundItem = true;
return true;
}
return false;
});
episodesResult.TotalRecordCount = episodesResult.Items.length;
return episodesResult;
});
episodesResult.TotalRecordCount = episodesResult.Items.length;
return episodesResult;
});
}
if (promise) {
return new Promise(function (resolve, reject) {
return promise.then(function (result) {
promise.then(function (result) {
resolve(result.Items);
});
return result ? result.Items : items;
});
} else {
return new Promise(function (resolve, reject) {
resolve(items);
});
return Promise.resolve(items);
}
}

View File

@ -25,6 +25,7 @@
$('#selectAudioLanguage', page).val(user.Configuration.AudioLanguagePreference || "");
$('#selectSubtitleLanguage', page).val(user.Configuration.SubtitleLanguagePreference || "");
page.querySelector('.chkEpisodeAutoPlay').checked = user.Configuration.EnableEpisodeAutoQueue;
});
$('#selectSubtitlePlaybackMode', page).val(user.Configuration.SubtitleMode || "").trigger('change');
@ -93,6 +94,7 @@
user.Configuration.SubtitleMode = $('#selectSubtitlePlaybackMode', page).val();
user.Configuration.PlayDefaultAudioTrack = page.querySelector('.chkPlayDefaultAudioTrack').checked;
user.Configuration.EnableEpisodeAutoQueue = page.querySelector('.chkEpisodeAutoPlay').checked;
AppSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked);

View File

@ -1528,5 +1528,6 @@
"HeaderNewRecording": "New Recording",
"ButtonAdvanced": "Advanced",
"LabelCodecIntrosPath": "Codec intros path:",
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature."
"LabelCodecIntrosPathHelp": "A folder containing video files. If an intro video file name matches the video codec, audio codec, audio profile, or a tag, then it will be played prior to the main feature.",
"OptionPlayNextEpisodeAutomatically": "Play next episode automatically"
}

View File

@ -1542,5 +1542,6 @@
"OptionConvertRecordingsToStreamingFormatHelp": "Recordings will be converted on the fly to MP4 for easy playback on your devices.",
"FeatureRequiresEmbyPremiere": "This feature requires an active Emby Premiere subscription.",
"FileExtension": "File extension",
"OptionReplaceExistingImages": "Replace existing images"
"OptionReplaceExistingImages": "Replace existing images",
"OptionPlayNextEpisodeAutomatically": "Play next episode automatically"
}