diff --git a/client/src/components/Settings.vue b/client/src/components/Settings.vue index f0e12512..8e42ec18 100644 --- a/client/src/components/Settings.vue +++ b/client/src/components/Settings.vue @@ -144,6 +144,13 @@ + + +
Sort moods
+
+ + +
@@ -207,6 +214,13 @@ + +
Sort moods
+
+ + +
+ @@ -266,6 +280,8 @@ + + @@ -496,6 +512,19 @@ function addMood() { } } +/// Sort moods +function sortMoods(dir: 1 | -1 = 1) { + $1t.settings.value.quickTag.moods.sort((a, b) => { + if (a.mood.toLowerCase() > b.mood.toLowerCase()) { + return 1 * dir; + } + if (a.mood.toLowerCase() < b.mood.toLowerCase()) { + return -1 * dir; + } + return 0; + }); +} + // Add new genre function addGenre() { if (!newGenre.value || newGenre.value.trim() == "") return; @@ -504,6 +533,19 @@ function addGenre() { newGenre.value = undefined; } +/// Sort genres +function sortGenres(dir: 1 | -1 = 1) { + $1t.settings.value.quickTag.genres.sort((a, b) => { + if (a.genre.toLowerCase() > b.genre.toLowerCase()) { + return 1 * dir; + } + if (a.genre.toLowerCase() < b.genre.toLowerCase()) { + return -1 * dir; + } + return 0; + }); +} + // On subgenres changed function onSubgenreInput(e: string | null, i: number) { if (!e) { @@ -546,6 +588,19 @@ function editCustomQT(i: number) { customQTEdit.value[i] = !customQTEdit.value[i]; } +/// Sort custom QT alphabetically +function sortCustomQT(i: number, dir: 1 | -1 = 1) { + $1t.settings.value.quickTag.custom[i].values.sort((a, b) => { + if (a.val.toLowerCase() > b.val.toLowerCase()) { + return 1 * dir; + } + if (a.val.toLowerCase() < b.val.toLowerCase()) { + return -1 * dir; + } + return 0; + }); +} + function addNewQTValue(i: number) { $1t.settings.value.quickTag.custom[i].values.push({val: "New", keybind: undefined}); //TODO: Focus on new value diff --git a/client/src/components/TagEditorAlbumArt.vue b/client/src/components/TagEditorAlbumArt.vue new file mode 100644 index 00000000..0ab366cc --- /dev/null +++ b/client/src/components/TagEditorAlbumArt.vue @@ -0,0 +1,95 @@ + + + + + \ No newline at end of file diff --git a/client/src/views/TagEditor.vue b/client/src/views/TagEditor.vue index ab155e70..4d5ccc70 100644 --- a/client/src/views/TagEditor.vue +++ b/client/src/views/TagEditor.vue @@ -132,6 +132,7 @@ +
Add new text tag
@@ -143,6 +144,7 @@
+
Album art @@ -152,13 +154,19 @@
- + +
@@ -359,6 +367,7 @@ import { computed, onDeactivated, onMounted, ref } from 'vue'; import { get1t } from '../scripts/onetagger'; import { useQuasar } from 'quasar'; import ManualTag from '../components/ManualTag.vue'; +import TagEditorAlbumArt from '../components/TagEditorAlbumArt.vue'; const $1t = get1t(); const $q = useQuasar(); @@ -527,6 +536,11 @@ function onChange(tag: string) { // Add new album art function addAlbumArt(data: any) { + // Find old image + file.value.images = file.value.images.filter((i: any) => i.kind != data.kind); + changes.value = changes.value.filter((c) => c.type != 'addPictureBase64' || c.kind != data.kind); + + // Add changes.value.push({ type: 'addPictureBase64', mime: data.mime,