mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5869 from gnattu/custom-audio-tag
Add non-standard multi-value audio tag support
This commit is contained in:
commit
a2676c25ce
3 changed files with 46 additions and 0 deletions
|
@ -12,6 +12,7 @@ import dom from '../../scripts/dom';
|
|||
import '../../elements/emby-checkbox/emby-checkbox';
|
||||
import '../../elements/emby-select/emby-select';
|
||||
import '../../elements/emby-input/emby-input';
|
||||
import '../../elements/emby-textarea/emby-textarea';
|
||||
import './style.scss';
|
||||
import template from './libraryoptionseditor.template.html';
|
||||
|
||||
|
@ -473,8 +474,10 @@ export function setContentType(parent, contentType) {
|
|||
|
||||
if (contentType === 'music') {
|
||||
parent.querySelector('.lyricSettingsSection').classList.remove('hide');
|
||||
parent.querySelector('.audioTagSettingsSection').classList.remove('hide');
|
||||
} else {
|
||||
parent.querySelector('.lyricSettingsSection').classList.add('hide');
|
||||
parent.querySelector('.audioTagSettingsSection').classList.add('hide');
|
||||
}
|
||||
|
||||
parent.querySelector('.chkAutomaticallyAddToCollectionContainer').classList.toggle('hide', contentType !== 'movies' && contentType !== 'mixed');
|
||||
|
@ -597,6 +600,8 @@ export function getLibraryOptions(parent) {
|
|||
SaveLyricsWithMedia: parent.querySelector('#chkSaveLyricsLocally').checked,
|
||||
RequirePerfectSubtitleMatch: parent.querySelector('#chkRequirePerfectMatch').checked,
|
||||
AutomaticallyAddToCollection: parent.querySelector('#chkAutomaticallyAddToCollection').checked,
|
||||
PreferNonstandardArtistsTag: parent.querySelector('#chkPreferNonstandardArtistsTag').checked,
|
||||
UseCustomTagDelimiters: parent.querySelector('#chkUseCustomTagDelimiters').checked,
|
||||
MetadataSavers: Array.prototype.map.call(Array.prototype.filter.call(parent.querySelectorAll('.chkMetadataSaver'), elem => {
|
||||
return elem.checked;
|
||||
}), elem => {
|
||||
|
@ -613,6 +618,8 @@ export function getLibraryOptions(parent) {
|
|||
}), elem => {
|
||||
return elem.getAttribute('data-lang');
|
||||
});
|
||||
options.CustomTagDelimiters = parent.querySelector('#customTagDelimitersInput').value.split('');
|
||||
options.DelimiterWhitelist = parent.querySelector('#tagDelimiterWhitelist').value.split('\n').filter(item => item.trim());
|
||||
setSubtitleFetchersIntoOptions(parent, options);
|
||||
setLyricFetchersIntoOptions(parent, options);
|
||||
setMetadataFetchersIntoOptions(parent, options);
|
||||
|
@ -661,12 +668,16 @@ export function setLibraryOptions(parent, options) {
|
|||
parent.querySelector('#chkSkipIfAudioTrackPresent').checked = options.SkipSubtitlesIfAudioTrackMatches;
|
||||
parent.querySelector('#chkRequirePerfectMatch').checked = options.RequirePerfectSubtitleMatch;
|
||||
parent.querySelector('#chkAutomaticallyAddToCollection').checked = options.AutomaticallyAddToCollection;
|
||||
parent.querySelector('#chkPreferNonstandardArtistsTag').checked = options.PreferNonstandardArtistsTag;
|
||||
parent.querySelector('#chkUseCustomTagDelimiters').checked = options.UseCustomTagDelimiters;
|
||||
Array.prototype.forEach.call(parent.querySelectorAll('.chkMetadataSaver'), elem => {
|
||||
elem.checked = options.MetadataSavers ? options.MetadataSavers.includes(elem.getAttribute('data-pluginname')) : elem.getAttribute('data-defaultenabled') === 'true';
|
||||
});
|
||||
Array.prototype.forEach.call(parent.querySelectorAll('.chkSubtitleLanguage'), elem => {
|
||||
elem.checked = !!options.SubtitleDownloadLanguages && options.SubtitleDownloadLanguages.includes(elem.getAttribute('data-lang'));
|
||||
});
|
||||
parent.querySelector('#customTagDelimitersInput').value = options.CustomTagDelimiters.join('');
|
||||
parent.querySelector('#tagDelimiterWhitelist').value = options.DelimiterWhitelist.filter(item => item.trim()).join('\n');
|
||||
renderMetadataReaders(parent, getOrderedPlugins(parent.availableOptions.MetadataReaders, options.LocalMetadataReaderOrder || []));
|
||||
renderMetadataFetchers(parent, parent.availableOptions, options);
|
||||
renderImageFetchers(parent, parent.availableOptions, options);
|
||||
|
|
|
@ -216,3 +216,29 @@
|
|||
<div class="fieldDescription checkboxFieldDescription">${SaveLyricsIntoMediaFoldersHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="audioTagSettingsSection hide">
|
||||
<h2>${LabelAudioTagSettings}</h2>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription advanced">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" id="chkPreferNonstandardArtistsTag" />
|
||||
<span>${PreferNonStandardArtistsTag}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${PreferNonstandardArtistsTagHelp}</div>
|
||||
</div>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription advanced">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" id="chkUseCustomTagDelimiters" />
|
||||
<span>${UseCustomTagDelimiters}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${UseCustomTagDelimitersHelp}</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<input type="text" is="emby-input" id="customTagDelimitersInput" label="${LabelCustomTagDelimiters}" value="/|;\"/>
|
||||
<div class="fieldDescription">${LabelCustomTagDelimitersHelp}</div>
|
||||
</div>
|
||||
<div class="inputContainer">
|
||||
<textarea is="emby-textarea" id="tagDelimiterWhitelist" label="${LabelDelimiterWhitelist}" class="textarea-mono" style="resize: none;min-height:2.5em"></textarea>
|
||||
<div class="fieldDescription">${LabelDelimiterWhitelistHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue