2020-02-22 06:04:52 +00:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title>MusicBrainz</title>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<div data-role="page" class="page type-interior pluginConfigurationPage musicBrainzConfigPage" data-require="emby-input,emby-button,emby-checkbox">
|
|
|
|
|
<div data-role="content">
|
|
|
|
|
<div class="content-primary">
|
|
|
|
|
<form class="musicBrainzConfigForm">
|
|
|
|
|
<div class="inputContainer">
|
2020-02-27 16:43:57 +00:00
|
|
|
|
<input is="emby-input" type="text" id="server" required label="Server" />
|
|
|
|
|
<div class="fieldDescription">This can be a mirror of the official server or even a custom server.</div>
|
2020-02-22 06:04:52 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="inputContainer">
|
2020-02-27 16:43:57 +00:00
|
|
|
|
<input is="emby-input" type="number" id="rateLimit" pattern="[0-9]*" required min="0" max="10000" label="Rate Limit" />
|
|
|
|
|
<div class="fieldDescription">Span of time between requests in milliseconds. The official server is limited to one request every two seconds.</div>
|
2020-02-22 06:04:52 +00:00
|
|
|
|
</div>
|
|
|
|
|
<label class="checkboxContainer">
|
|
|
|
|
<input is="emby-checkbox" type="checkbox" id="enable" />
|
|
|
|
|
<span>Enable this provider for metadata searches on artists and albums.</span>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="checkboxContainer">
|
|
|
|
|
<input is="emby-checkbox" type="checkbox" id="replaceArtistName" />
|
|
|
|
|
<span>When an artist is found during a metadata search, replace the artist name with the value on the server.</span>
|
|
|
|
|
</label>
|
|
|
|
|
<br />
|
|
|
|
|
<div>
|
|
|
|
|
<button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var MusicBrainzPluginConfig = {
|
|
|
|
|
uniquePluginId: "8c95c4d2-e50c-4fb0-a4f3-6c06ff0f9a1a"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$('.musicBrainzConfigPage').on('pageshow', function () {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
$('#server').val(config.Server).change();
|
|
|
|
|
$('#rateLimit').val(config.RateLimit).change();
|
2020-05-25 09:25:45 +00:00
|
|
|
|
$('#enable').checked = config.Enable;
|
|
|
|
|
$('#replaceArtistName').checked = config.ReplaceArtistName;
|
2020-02-22 06:04:52 +00:00
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.musicBrainzConfigForm').on('submit', function (e) {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var form = this;
|
|
|
|
|
ApiClient.getPluginConfiguration(MusicBrainzPluginConfig.uniquePluginId).then(function (config) {
|
|
|
|
|
config.Server = $('#server', form).val();
|
|
|
|
|
config.RateLimit = $('#rateLimit', form).val();
|
2020-05-25 09:25:45 +00:00
|
|
|
|
config.Enable = $('#enable', form).checked;
|
|
|
|
|
config.ReplaceArtistName = $('#replaceArtistName', form).checked;
|
2020-02-22 06:04:52 +00:00
|
|
|
|
|
|
|
|
|
ApiClient.updatePluginConfiguration(MusicBrainzPluginConfig.uniquePluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|