Skip to content

Commit

Permalink
required labels on recording defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
hinanaya committed Jun 11, 2024
1 parent 73b210f commit 69f4b48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions js/media/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,10 @@ OB.Media.recordingDefaultsGet = function () {
metaElem.dataset.name = meta.name;
metaElem.dataset.edit = "";

if (meta.settings.mode === "required") {
labelElem.classList.add("required");
}

const rowElem = document.createElement('div');
rowElem.classList.add('fieldrow');

Expand All @@ -653,6 +657,18 @@ OB.Media.recordingDefaultsGet = function () {
document.querySelector('#recording_defaults_language').value = defaults.language;
document.querySelector('#recording_defaults_comments').value = defaults.comments;

['album', 'year', 'country', 'language', 'comments'].forEach((meta) => {
if (OB.Settings.media_required_fields[meta] === 'required') {
let elem = document.querySelector('#recording_defaults_' + meta).closest('.fieldrow').querySelector('label');
elem.classList.add('required');
}
});

let genreLabel = document.querySelector('#recording_defaults_genre').closest('.fieldrow').querySelector('label');
if (OB.Settings.media_required_fields.category_id === 'required') {
genreLabel.classList.add('required');
}

// Set custom metadata according to saved settings, and if none can be found, use the default
// settings for that field (if any).
OB.Settings.media_metadata.forEach((meta) => {
Expand Down

0 comments on commit 69f4b48

Please sign in to comment.