Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add settings MarkResumableItemUnplayedOnPlay and UpdateLastPlayedAndPlayCountOnPlayCompletion to Playback config page #3805

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/controllers/dashboard/playback.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ <h2 class="sectionTitle">${ButtonResume}</h2>
${LabelMinResumeDurationHelp}
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkMarkResumableItemUnplayedOnPlay" />
<span>${LabelMarkResumableItemUnplayedOnPlay}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelMarkResumableItemUnplayedOnPlayHelp}</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkUpdateLastPlayedAndPlayCountOnPlayCompletion" />
<span>${LabelUpdateLastPlayedAndPlayCountOnPlayCompletion}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${LabelUpdateLastPlayedAndPlayCountOnPlayCompletionHelp}</div>
</div>

<div><button is="emby-button" type="submit" class="raised button-submit block"><span>${Save}</span></button></div>
</form>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/dashboard/playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ function loadPage(page, config) {
$('#txtMinAudiobookResume', page).val(config.MinAudiobookResume);
$('#txtMaxAudiobookResume', page).val(config.MaxAudiobookResume);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
page.querySelector('#chkMarkResumableItemUnplayedOnPlay').checked = config.MarkResumableItemUnplayedOnPlay || false;
page.querySelector('#chkUpdateLastPlayedAndPlayCountOnPlayCompletion').checked = config.UpdateLastPlayedAndPlayCountOnPlayCompletion || false;
loading.hide();
}

Expand All @@ -22,6 +24,8 @@ function onSubmit() {
config.MinAudiobookResume = $('#txtMinAudiobookResume', form).val();
config.MaxAudiobookResume = $('#txtMaxAudiobookResume', form).val();
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
config.MarkResumableItemUnplayedOnPlay = form.querySelector('#chkMarkResumableItemUnplayedOnPlay').checked;
config.UpdateLastPlayedAndPlayCountOnPlayCompletion = form.querySelector('#chkUpdateLastPlayedAndPlayCountOnPlayCompletion').checked;

ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
Expand Down
4 changes: 4 additions & 0 deletions src/strings/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,8 @@
"LabelLogs": "Logs",
"LabelManufacturer": "Manufacturer",
"LabelManufacturerUrl": "Manufacturer URL",
"LabelMarkResumableItemUnplayedOnPlay": "Mark item unplayed when playback starts",
"LabelMarkResumableItemUnplayedOnPlayHelp": "Mark resumable items as unplayed when playback starts.",
"LabelMatchType": "Match type",
"LabelMaxAudiobookResume": "Audiobook remaining minutes to resume",
"LabelMaxAudiobookResumeHelp": "Titles are assumed fully played if stopped when the remaining duration is less than this value.",
Expand Down Expand Up @@ -969,6 +971,8 @@
"LabelTypeMetadataDownloaders": "Metadata downloaders ({0})",
"LabelTypeText": "Text",
"LabelUnstable": "Unstable",
"LabelUpdateLastPlayedAndPlayCountOnPlayCompletion": "Update last played and play count when completed",
"LabelUpdateLastPlayedAndPlayCountOnPlayCompletionHelp": "Increment play count and update last played time when resumable item played to completion as determined by the resume settings. If false, date and count will be update when playback starts.",
"LabelUser": "User",
"LabelUserAgent": "User agent",
"LabelUserLibrary": "User library",
Expand Down
Loading