Skip to content

Commit

Permalink
影片类别替换
Browse files Browse the repository at this point in the history
  • Loading branch information
JavScraper committed Jun 3, 2020
1 parent f797cb5 commit 421a00d
Show file tree
Hide file tree
Showing 3 changed files with 520 additions and 3 deletions.
28 changes: 27 additions & 1 deletion Emby.Plugins.JavScraper/Configuration/ConfigPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ <h3 class="checkboxListLabel">翻译:</h3>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableBaiduFanyiOptionsGenre" />
<span>类别</span>
<span>类别 (不推荐)</span>
</label>
<div class="fieldDescription checkboxFieldDescription"></div>
</div>
Expand All @@ -288,6 +288,26 @@ <h3 class="checkboxListLabel">翻译:</h3>
</div>
</div>

<div>
<h3 class="checkboxListLabel">影片类别替换:</h3>
<div class="paperList checkboxList-paperList">

<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnableGenreReplace" />
<span>开启类别替换</span>
</label>
<div class="fieldDescription checkboxFieldDescription"></div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabel-float inputLabelUnfocused" for="txtGenreReplaceMap">类别替换表:</label>
<textarea rows="10" is="emby-input" type="text" id="txtGenreReplaceMap" name="txtGenreReplaceMap" class="emby-input"></textarea>
<div class="fieldDescription"></div>
</div>
<div class="fieldDescription">该功能优先级高于百度翻译中的类别翻译项。每行一条记录,两个类别之间用小写的冒号隔开,当目标类别为XXXX时,表示去除该类别。</div>
</div>
</div>

<br />

<div>
Expand Down Expand Up @@ -404,6 +424,9 @@ <h3 class="checkboxListLabel">翻译:</h3>
page.querySelector('#chkEnableBaiduFanyiOptionsGenre').checked = (config.BaiduFanyiOptions & (1 << 1)) != 0;
page.querySelector('#chkEnableBaiduFanyiOptionsPlot').checked = (config.BaiduFanyiOptions & (1 << 2)) != 0;

page.querySelector('#chkEnableGenreReplace').checked = config.EnableGenreReplace;
$('#txtGenreReplaceMap', page).val(config.GenreReplaceMap).change();

var html = '';
config.Scrapers.forEach(function (e) {
html += '<div class="listItem listItem-border sortableOption sortItem" data-sort="' + e + '">';
Expand Down Expand Up @@ -464,6 +487,9 @@ <h3 class="checkboxListLabel">翻译:</h3>
if ($('#chkEnableBaiduFanyiOptionsPlot').prop('checked'))
config.BaiduFanyiOptions |= (1 << 2);

config.EnableGenreReplace = $('#chkEnableGenreReplace').prop('checked');
config.GenreReplaceMap = $('#txtGenreReplaceMap', form).val();

var scrapers = [];
$('input[name=JavScraperItem]').each(function (index) {
var scraper = new Object();
Expand Down
Loading

0 comments on commit 421a00d

Please sign in to comment.