Added a post-download hook for applying processing of downloaded audio before adding to library.
This commit is contained in:
@@ -19,6 +19,8 @@ public class PluginConfiguration : BasePluginConfiguration
|
||||
MaxEpisodesPerPodcast = 50;
|
||||
CreatePodcastFolders = true;
|
||||
DownloadNewEpisodesOnly = true;
|
||||
PostDownloadScriptPath = string.Empty;
|
||||
PostDownloadScriptTimeout = 60;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,4 +58,15 @@ public class PluginConfiguration : BasePluginConfiguration
|
||||
/// Gets or sets a value indicating whether to only download new episodes after subscription.
|
||||
/// </summary>
|
||||
public bool DownloadNewEpisodesOnly { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to post-download processing script.
|
||||
/// Script is called with: script input_file output_file.
|
||||
/// </summary>
|
||||
public string PostDownloadScriptPath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the timeout in seconds for post-download script execution.
|
||||
/// </summary>
|
||||
public int PostDownloadScriptTimeout { get; set; }
|
||||
}
|
||||
|
||||
@@ -166,6 +166,29 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Post-Download Processing -->
|
||||
<div class="verticalSection">
|
||||
<h3 class="sectionTitle">Post-Download Processing</h3>
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="PostDownloadScriptPath">
|
||||
Post-Download Script Path
|
||||
</label>
|
||||
<input id="PostDownloadScriptPath" name="PostDownloadScriptPath" type="text" is="emby-input" />
|
||||
<div class="fieldDescription">
|
||||
Optional script to process episodes after download. Called as: script input_file output_file
|
||||
</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="PostDownloadScriptTimeout">
|
||||
Script Timeout (seconds)
|
||||
</label>
|
||||
<input id="PostDownloadScriptTimeout" name="PostDownloadScriptTimeout" type="number" is="emby-input" min="1" max="3600" />
|
||||
<div class="fieldDescription">
|
||||
Maximum time to wait for script completion (default: 60 seconds)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
|
||||
<span>Save Settings</span>
|
||||
@@ -229,6 +252,8 @@
|
||||
document.querySelector('#MaxConcurrentDownloads').value = config.MaxConcurrentDownloads;
|
||||
document.querySelector('#MaxEpisodesPerPodcast').value = config.MaxEpisodesPerPodcast;
|
||||
document.querySelector('#CreatePodcastFolders').checked = config.CreatePodcastFolders;
|
||||
document.querySelector('#PostDownloadScriptPath').value = config.PostDownloadScriptPath || '';
|
||||
document.querySelector('#PostDownloadScriptTimeout').value = config.PostDownloadScriptTimeout || 60;
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
@@ -408,6 +433,8 @@
|
||||
config.MaxConcurrentDownloads = parseInt(document.querySelector('#MaxConcurrentDownloads').value, 10);
|
||||
config.MaxEpisodesPerPodcast = parseInt(document.querySelector('#MaxEpisodesPerPodcast').value, 10);
|
||||
config.CreatePodcastFolders = document.querySelector('#CreatePodcastFolders').checked;
|
||||
config.PostDownloadScriptPath = document.querySelector('#PostDownloadScriptPath').value;
|
||||
config.PostDownloadScriptTimeout = parseInt(document.querySelector('#PostDownloadScriptTimeout').value, 10);
|
||||
ApiClient.updatePluginConfiguration(JellypodConfig.pluginUniqueId, config).then(function (result) {
|
||||
Dashboard.processPluginConfigurationUpdateResult(result);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user