Add maximum introduction duration
This commit is contained in:
parent
7612e6cdaf
commit
c937e28d45
@ -62,6 +62,11 @@ public class PluginConfiguration : BasePluginConfiguration
|
||||
/// </summary>
|
||||
public int MinimumIntroDuration { get; set; } = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the maximum length of similar audio that will be considered an introduction.
|
||||
/// </summary>
|
||||
public int MaximumIntroDuration { get; set; } = 120;
|
||||
|
||||
// ===== Playback settings =====
|
||||
|
||||
/// <summary>
|
||||
|
@ -139,6 +139,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="MaximumIntroDuration">
|
||||
Maximum introduction duration (in seconds)
|
||||
</label>
|
||||
<input id="MaximumIntroDuration" type="number" is="emby-input" min="1" />
|
||||
<div class="fieldDescription">
|
||||
Similar sounding audio which is longer than this duration will not be considered an
|
||||
introduction.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
The amount of each episode's audio that will be analyzed is determined using both
|
||||
the percentage of audio and maximum runtime of audio to analyze. The minimum of
|
||||
@ -373,6 +384,7 @@
|
||||
"AnalysisPercent",
|
||||
"AnalysisLengthLimit",
|
||||
"MinimumIntroDuration",
|
||||
"MaximumIntroDuration",
|
||||
"EdlAction",
|
||||
// playback
|
||||
"ShowPromptAdjustment",
|
||||
|
@ -304,8 +304,12 @@ public class AnalyzeEpisodesTask : IScheduledTask
|
||||
remainingEpisode.EpisodeId,
|
||||
fingerprintCache[remainingEpisode.EpisodeId]);
|
||||
|
||||
// If one of the intros isn't valid, ignore this comparison result.
|
||||
if (!currentIntro.Valid)
|
||||
// Ignore this comparison result if:
|
||||
// - one of the intros isn't valid, or
|
||||
// - the introduction exceeds the configured limit
|
||||
if (
|
||||
!remainingIntro.Valid ||
|
||||
remainingIntro.Duration > Plugin.Instance!.Configuration.MaximumIntroDuration)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user