jellyfin-plugin-metashark/Jellyfin.Plugin.MetaShark/Configuration/configPage.html

157 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Template</title>
</head>
<body>
<div id="TemplateConfigPage" data-role="page" class="page type-interior pluginConfigurationPage"
data-require="emby-input,emby-button,emby-select,emby-checkbox">
<div data-role="content">
<div class="content-primary">
<div class="verticalSection verticalSection">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">MetaShark 配置</h2><span id="current_version" name="current_version"
is="emby-linkbutton" class="emby-button"></span>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton emby-button" target="_blank"
href="https://github.com/cxfksword/jellyfin-plugin-metashark">源码</a>
</div>
</div>
<form id="TemplateConfigForm">
<fieldset class="verticalSection verticalSection-extrabottompadding">
<legend>
<h3>豆瓣</h3>
</legend>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="DoubanCookies">豆瓣网站cookie<span
id="login_invalid"
style="color: red; margin-left: 8px; display: none;">(已失效)</span></label>
<textarea rows="5" is="emby-input" type="text" id="DoubanCookies" name="DoubanCookies"
class="emby-input" placeholder="_vwo_uuid_v2=1; __utmv=2; ..."></textarea>
<div class="fieldDescription">可为空,填写可搜索到需登录访问的影片,使用(www.douban.com)分号“;”分隔格式cookie.</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label" for="EnableDoubanAvoidRiskControl">
<input id="EnableDoubanAvoidRiskControl" name="EnableDoubanAvoidRiskControl"
type="checkbox" is="emby-checkbox" />
<span class="checkboxLabel" style="position:relative">启用防封禁
<!-- <span
style="width:24px;color:red;font-size:12px;position: absolute;top:-3px;margin-left:3px;">实险</span> -->
<img style="position: absolute; top:-12px; width: 32px; height:32px"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA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mJgsMtwV5SaIdu2Htz8846wFUNwFg09BwxyYlzGnhRN+xHC1Jk3q6b9uXyezT0ADv/qWUWiFyVnycFTuiGdYt0snVFKxynTwG2MbAZzEO6acv6sawKSGjh9YDzJYMaxeQOaGuXkTqZBRA6yaCbHIV7uqbsr2RalG6t/2Kmu4hY3DVcg+ydQ3sJgNIUe0Y3rMcKcIvyXBTPQuGscIRflAISWmg3g94oj1SxgeLZePMlLelAZjeYzuaXw4QW3MJQTuXe/UQ3rO35vplApofBqxUok51G6rMKUSs5v4uIAughoEM3LFlAZZQZm5kwzMSDRIHfY1PJKQk5Gt4P5qeL7b5oAHFNfRzAoUr5Wi5RdpQHYz+nZAETreI+AHTYgXM4ZthiM1RoQsqK4+xhQB6u8q3c4EQkvI+Jn2Xm+2Om/XrJGJFQHxEdyb8zqoVvVsCDiwYQ10IvACTzuGJjlmt0oREJ+Z4B8AOAKAixOXaCooSfI8ZZ8S5D3jHG5pwHOMbAdyLSIGzL9yNghkEfMXOjQtjIwBXyWZFdTNRMQPtcQOe8D4hr6rsA7p7HqJp85CoF4lH1UzBklfVSc3UlVr6h8RIAAAtfinrl6qtS4Fxdi+c2D3sAtHok+kvzx4hHYMxyw/WtsA/AowR8BXg0sK7d8hXgGpVHO/oK8GhgXbvlK8A1Ko929BXg0cC6dstXgGtUHu3oK8CjgXXtlq8A16g82vFfwx5yXxq/mYIAAAAASUVORK5CYII="
alt="beta" />
</span>
</label>
<div class="fieldDescription">勾选后刮削会变慢适合刮削大量影片时使用建议搭配网站cookie一起使用</div>
</div>
</fieldset>
<fieldset class="verticalSection verticalSection-extrabottompadding">
<legend>
<h3>TheMovieDb</h3>
</legend>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label" for="EnableTmdb">
<input id="EnableTmdb" name="EnableTmdb" type="checkbox" is="emby-checkbox" />
<span>启用从TheMovieDb获取元数据</span>
</label>
<div class="fieldDescription">勾选后会尝试从TheMovieDb获取剧集元数据</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label" for="EnableTmdbSearch">
<input id="EnableTmdbSearch" name="EnableTmdbSearch" type="checkbox"
is="emby-checkbox" />
<span>显示TheMovieDb搜索结果</span>
</label>
<div class="fieldDescription">勾选后识别时会同时返回TheMovieDb搜索结果</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TmdbApiKey">Api Key</label>
<input id="TmdbApiKey" name="TmdbApiKey" type="text" is="emby-input" />
<div class="fieldDescription">填写自定义Api Key不填写会使用默认api key.(需重启才能生效)</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="TmdbHost">Api Host</label>
<input id="TmdbHost" name="TmdbHost" type="text" is="emby-input"
placeholder="api.tmdb.org" />
<div class="fieldDescription">
填写Api域名可选api.tmdb.org/api.themoviedb.org默认api.tmdb.org.(需重启才能生效)</div>
</div>
</fieldset>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
</button>
</form>
</div>
</div>
<script type="text/javascript">
var TemplateConfig = {
pluginUniqueId: '9A19103F-16F7-4668-BE54-9A1E7A4F7556'
};
document.querySelector('#TemplateConfigPage')
.addEventListener('pageshow', function () {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {
$('#current_version').text("v" + config.Version);
document.querySelector('#DoubanCookies').value = config.DoubanCookies;
document.querySelector('#EnableDoubanAvoidRiskControl').checked = config.EnableDoubanAvoidRiskControl;
document.querySelector('#EnableTmdb').checked = config.EnableTmdb;
document.querySelector('#EnableTmdbSearch').checked = config.EnableTmdbSearch;
document.querySelector('#TmdbApiKey').value = config.TmdbApiKey;
document.querySelector('#TmdbHost').value = config.TmdbHost;
checkDoubanLogin();
Dashboard.hideLoadingMsg();
});
});
document.querySelector('#TemplateConfigForm')
.addEventListener('submit', function (e) {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {
config.DoubanCookies = document.querySelector('#DoubanCookies').value;
config.EnableDoubanAvoidRiskControl = document.querySelector('#EnableDoubanAvoidRiskControl').checked;
config.EnableTmdb = document.querySelector('#EnableTmdb').checked;
config.EnableTmdbSearch = document.querySelector('#EnableTmdbSearch').checked;
config.TmdbApiKey = document.querySelector('#TmdbApiKey').value;
config.TmdbHost = document.querySelector('#TmdbHost').value;
ApiClient.updatePluginConfiguration(TemplateConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
checkDoubanLogin();
});
});
e.preventDefault();
return false;
});
function checkDoubanLogin() {
let cookie = document.querySelector('#DoubanCookies').value
if (!cookie || !$.trim(cookie)) {
$('#login_invalid').hide();
return;
}
$.getJSON("/plugin/metashark/douban/checklogin", function (resp) {
if (resp && resp.code != 1) {
$('#login_invalid').show();
} else {
$('#login_invalid').hide();
}
})
}
</script>
</div>
</body>
</html>