Add skipping last episode minus the episode
Needs to determine if the current episode is the last episode, but this fills in all the UI and config
This commit is contained in:
parent
93f0bee301
commit
ad186140bd
@ -163,6 +163,11 @@ public class PluginConfiguration : BasePluginConfiguration
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool SkipFirstEpisode { get; set; } = true;
|
public bool SkipFirstEpisode { get; set; } = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets a value indicating whether the introduction in the last episode of a season should be ignored.
|
||||||
|
/// </summary>
|
||||||
|
public bool SkipLastEpisode { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether the skip button should be displayed for the duration of the intro.
|
/// Gets or sets a value indicating whether the skip button should be displayed for the duration of the intro.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -375,6 +375,18 @@
|
|||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="divSkipLastEpisode" class="checkboxContainer checkboxContainer-withDescription">
|
||||||
|
<label class="emby-checkbox-label">
|
||||||
|
<input id="SkipLastEpisode" type="checkbox" is="emby-checkbox" />
|
||||||
|
<span>Play intro for last episode of a season</span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<div class="fieldDescription">
|
||||||
|
If checked, auto skip will play the introduction of the last episode in a season.<br />
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="divSecondsOfIntroStartToPlay" class="inputContainer">
|
<div id="divSecondsOfIntroStartToPlay" class="inputContainer">
|
||||||
<label class="inputLabel inputLabelUnfocused" for="SecondsOfIntroStartToPlay">
|
<label class="inputLabel inputLabelUnfocused" for="SecondsOfIntroStartToPlay">
|
||||||
Intro skip delay (in seconds)
|
Intro skip delay (in seconds)
|
||||||
@ -418,7 +430,7 @@
|
|||||||
|
|
||||||
<div class="fieldDescription">
|
<div class="fieldDescription">
|
||||||
If checked, a skip button will be displayed according to the settings below, while
|
If checked, a skip button will be displayed according to the settings below, while
|
||||||
clients selected in the Auto Skip Client List will skip <strong>automatically</strong>.
|
clients selected in the Auto Skip Client List will skip <strong>automatically</strong>.
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -817,6 +829,7 @@
|
|||||||
"AutoSkip",
|
"AutoSkip",
|
||||||
"AutoSkipCredits",
|
"AutoSkipCredits",
|
||||||
"SkipFirstEpisode",
|
"SkipFirstEpisode",
|
||||||
|
"SkipLastEpisode",
|
||||||
"PersistSkipButton",
|
"PersistSkipButton",
|
||||||
"SkipButtonVisible"
|
"SkipButtonVisible"
|
||||||
]
|
]
|
||||||
@ -850,6 +863,7 @@
|
|||||||
var selectAllLibraries = document.querySelector("input#SelectAllLibraries");
|
var selectAllLibraries = document.querySelector("input#SelectAllLibraries");
|
||||||
var librariesContainer = document.querySelector("div.folderAccessListContainer");
|
var librariesContainer = document.querySelector("div.folderAccessListContainer");
|
||||||
var skipFirstEpisode = document.querySelector("div#divSkipFirstEpisode");
|
var skipFirstEpisode = document.querySelector("div#divSkipFirstEpisode");
|
||||||
|
var skipLastEpisode = document.querySelector("div#divSkipLastEpisode");
|
||||||
var secondsOfIntroStartToPlay = document.querySelector("div#divSecondsOfIntroStartToPlay");
|
var secondsOfIntroStartToPlay = document.querySelector("div#divSecondsOfIntroStartToPlay");
|
||||||
var autoSkipClientList = document.getElementById("AutoSkipClientList");
|
var autoSkipClientList = document.getElementById("AutoSkipClientList");
|
||||||
var secondsOfCreditsStartToPlay = document.querySelector("div#divSecondsOfCreditsStartToPlay");
|
var secondsOfCreditsStartToPlay = document.querySelector("div#divSecondsOfCreditsStartToPlay");
|
||||||
@ -892,10 +906,12 @@
|
|||||||
function autoSkipChanged() {
|
function autoSkipChanged() {
|
||||||
if (autoSkip.checked) {
|
if (autoSkip.checked) {
|
||||||
skipFirstEpisode.style.display = 'unset';
|
skipFirstEpisode.style.display = 'unset';
|
||||||
|
skipLastEpisode.style.display = 'unset';
|
||||||
autoSkipNotificationText.style.display = 'unset';
|
autoSkipNotificationText.style.display = 'unset';
|
||||||
secondsOfIntroStartToPlay.style.display = 'unset';
|
secondsOfIntroStartToPlay.style.display = 'unset';
|
||||||
} else {
|
} else {
|
||||||
skipFirstEpisode.style.display = 'none';
|
skipFirstEpisode.style.display = 'none';
|
||||||
|
skipLastEpisode.style.display = 'none';
|
||||||
autoSkipNotificationText.style.display = 'none';
|
autoSkipNotificationText.style.display = 'none';
|
||||||
secondsOfIntroStartToPlay.style.display = 'none';
|
secondsOfIntroStartToPlay.style.display = 'none';
|
||||||
}
|
}
|
||||||
|
@ -87,12 +87,18 @@ public class AutoSkip(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is the first episode in the season, and SkipFirstEpisode is false, pretend that we've already sent the seek command for this playback session.
|
// If this is the first episode in the season, and SkipFirstEpisode is true, pretend that we've already sent the seek command for this playback session.
|
||||||
if (Plugin.Instance!.Configuration.SkipFirstEpisode && episodeNumber == 1)
|
if (Plugin.Instance!.Configuration.SkipFirstEpisode && episodeNumber == 1)
|
||||||
{
|
{
|
||||||
newState = true;
|
newState = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If this is the last episode in the season, and SkipLastEpisode is true, pretend that we've already sent the seek command for this playback session.
|
||||||
|
if (Plugin.Instance!.Configuration.SkipLastEpisode && episodeNumber == 1)
|
||||||
|
{
|
||||||
|
newState = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the seek command state for this device.
|
// Reset the seek command state for this device.
|
||||||
lock (_sentSeekCommandLock)
|
lock (_sentSeekCommandLock)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user