Skip to content

Commit

Permalink
id3 key column on custom metadata fields
Browse files Browse the repository at this point in the history
  • Loading branch information
hinanaya committed Jun 24, 2024
1 parent 4985f67 commit 89b5a16
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions controllers/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function metadata_save()
$data['type'] = trim($this->data('type'));
$data['select_options'] = trim($this->data('select_options'));
$data['mode'] = trim($this->data('mode'));
$data['id3_key'] = trim($this->data('id3_key'));

$data['default'] = $this->data('default');
if (is_array($data['default'])) {
Expand Down
5 changes: 5 additions & 0 deletions html/media/metadata_addedit.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
<ob-field-select data-edit class="hidden metadata_default metadata_default_select"></ob-field-select>
<ob-tag-input data-suggestions="false" class="hidden metadata_default metadata_default_tags"></ob-tag-input>
</div>

<div class="fieldrow">
<label data-t>ID3 Key</label>
<ob-field-text data-edit id="metadata_id3_key"></ob-field-text>
</div>
</fieldset>

<fieldset>
Expand Down
8 changes: 7 additions & 1 deletion js/media/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,12 @@ OB.Media.metadataAddEditWindow = function(id)
{
$('#metadata_tag_suggestions').val(metadata.settings.suggestions);
}
document.querySelector("#metadata_mode").value = metadata.settings.mode;
if (metadata.settings.mode) {
document.querySelector("#metadata_mode").value = metadata.settings.mode;
}
if (metadata.settings.id3_key) {
document.querySelector("#metadata_id3_key").value = metadata.settings.id3_key;
}
if(metadata.settings && metadata.settings.default) metadata_set_default = metadata.settings.default;
return false; // break out of each
}
Expand Down Expand Up @@ -447,6 +452,7 @@ OB.Media.metadataSave = function()
field.tag_suggestions = $('#metadata_tag_suggestions').val();
field.default = $('#metadata_default').val();
field.mode = document.querySelector('#metadata_mode').value;
field.id3_key = document.querySelector('#metadata_id3_key').value;

OB.API.post('metadata','metadata_save',field,function(response)
{
Expand Down
3 changes: 2 additions & 1 deletion models/mediametadata_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,10 @@ public function save($data, $id)
$save['settings']['options'] = $save_options;
}

// mode and default
// mode, default, and id3 key
$save['settings']['mode'] = $data['mode'];
$save['settings']['default'] = $data['default'];
$save['settings']['id3_key'] = $data['id3_key'];

// tag suggestions
if ($data['type'] == 'tags') {
Expand Down

0 comments on commit 89b5a16

Please sign in to comment.