diff --git a/KillStreams/Config/PluginConfig.cs b/KillStreams/Config/PluginConfig.cs
index 2150c5e..71d00cb 100644
--- a/KillStreams/Config/PluginConfig.cs
+++ b/KillStreams/Config/PluginConfig.cs
@@ -13,5 +13,6 @@ public class PluginConfig : BasePluginConfiguration
public bool Allow4KAudioTranscode { get; set; }
public bool NagTranscode { get; set; }
public short PausedDurationMin { get; set; }
+ public bool AllowUnknownTranscode { get; set; }
}
}
\ No newline at end of file
diff --git a/KillStreams/Config/configPage.html b/KillStreams/Config/configPage.html
index c475114..17231c5 100644
--- a/KillStreams/Config/configPage.html
+++ b/KillStreams/Config/configPage.html
@@ -15,6 +15,7 @@
@@ -79,6 +80,24 @@
Kill Script Setup
$('#Allow4KAudioTranscodeDiv').html(html);
+ html = "";
+ checked = "";
+ value = false
+ if(config.AllowUnknownTranscode)
+ {
+ checked = "checked";
+ value = true;
+
+ }
+ html += '
' +
+ ' ' +
+ '
'
+
+ $('#AllowUnknownTranscodeDiv').html(html);
+
html = "";
checked = "";
value = false
@@ -137,6 +156,7 @@
Kill Script Setup
config.Allow4KAudioTranscode = $('#Allow4KAudioTranscode', page).val();
config.NagTranscode = $('#NagTranscode', page).val();
config.PausedDurationMin = $('#PausedDurationMin', page).val();
+ config.AllowUnknownTranscode = $('#AllowUnknownTranscode', page).val();
ApiClient.updatePluginConfiguration(ConfigurationPage.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
diff --git a/KillStreams/KillStreamScheduledTask.cs b/KillStreams/KillStreamScheduledTask.cs
index 25fd227..5d0a9a6 100644
--- a/KillStreams/KillStreamScheduledTask.cs
+++ b/KillStreams/KillStreamScheduledTask.cs
@@ -49,7 +49,7 @@ public async Task Execute(CancellationToken cancellationToken, IProgress
string.Equals(x.Id, sessionManagerSession.PlayState.MediaSourceId,
StringComparison.OrdinalIgnoreCase));
- if (mediaSourceItem == null)
+ if (mediaSourceItem == null && !Plugin.Instance.PluginConfiguration.AllowUnknownTranscode)
{
var sources = sessionManagerSession.FullNowPlayingItem.GetMediaSources(false, false,
new LibraryOptions());
@@ -78,8 +78,13 @@ await SessionManager.SendMessageCommand(null, sessionManagerSession.Id,
//TimeoutMs = 10000
},
new CancellationToken());
- return;
+ continue;
+ }
+
+ if (mediaSourceItem == null && Plugin.Instance.PluginConfiguration.AllowUnknownTranscode)
+ {
+ continue;
}
Logger.Info(
@@ -122,7 +127,7 @@ await SessionManager.SendMessageCommand(null, sessionManagerSession.Id,
SessionManager.ReportSessionEnded(sessionManagerSession.Id);
- return;
+ continue;
}
if (sessionManagerSession.TranscodingInfo != null && is4K &&
@@ -154,7 +159,7 @@ await SessionManager.SendMessageCommand(null, sessionManagerSession.Id,
},
new CancellationToken());
- return;
+ continue;
}
if (is4K && Plugin.Instance.PluginConfiguration.Allow4KAudioTranscode &&
@@ -179,7 +184,7 @@ await SessionManager.SendMessageCommand(null, sessionManagerSession.Id,
},
new CancellationToken());
- return;
+ continue;
}
}
@@ -203,7 +208,7 @@ await SessionManager.SendMessageCommand(null, sessionManagerSession.Id,
},
new CancellationToken());
- return;
+ continue;
}
}