Skip to content

Commit

Permalink
More tags
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrudnik committed Oct 28, 2023
1 parent 8699d29 commit 114d069
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 7 deletions.
83 changes: 83 additions & 0 deletions frontend/src/components/parts/TagOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,40 @@

<SearchTag :tag="tag" v-for="tag in tempoTags" :key="tag.id" show-count />
</SectionHeadline>

<SectionHeadline :title="t('tag-overview.file.title')">
<template #description>
<p>{{ t('tag-overview.file.description') }}</p>
</template>

<div class="mb-3" v-if="filesYear">
<SearchTag :tag="tag" v-for="tag in filesYear" :key="tag.id" show-count />
</div>

<div class="mb-3" v-if="filesMonth">
<SearchTag :tag="tag" v-for="tag in filesMonth" :key="tag.id" show-count />
</div>

<div class="mb-3" v-if="filesQuarter">
<SearchTag :tag="tag" v-for="tag in filesQuarter" :key="tag.id" show-count />
</div>

<div class="mb-3" v-if="filesWeekday">
<SearchTag :tag="tag" v-for="tag in filesWeekday" :key="tag.id" show-count />
</div>

<div class="mb-3" v-if="filesWeekNo">
<SearchTag :tag="tag" v-for="tag in filesWeekNo" :key="tag.id" show-count />
</div>

<div class="mb-3">
<SearchTag :tag="tag" v-for="tag in wZodiacs" :key="tag.id" show-count />
</div>

<div class="mb-3">
<SearchTag :tag="tag" v-for="tag in cZodiacs" :key="tag.id" show-count />
</div>
</SectionHeadline>
</template>

<script setup lang="ts">
Expand Down Expand Up @@ -69,4 +103,53 @@ const tempoTags = computed(() =>
'value'
)
)
const filesYear = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.includes('time-year:')),
['id', 'value']
)
)
const filesMonth = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.includes('time-month:')),
['id', 'value']
)
)
const filesQuarter = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.includes('time-quarter:')),
['id', 'value']
)
)
const filesWeekday = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.includes('time-weekday:')),
['id', 'value']
)
)
const filesWeekNo = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.includes('time-weekno:')),
['id', 'value']
)
)
const wZodiacs = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.startsWith('sys:file:zodiac-western:')),
'value'
)
)
const cZodiacs = computed(() =>
sortBy(
useTagStore().entries.filter((tag) => tag.id.startsWith('sys:file:zodiac-chinese:')),
'value'
)
)
</script>
32 changes: 27 additions & 5 deletions frontend/src/components/structure/SearchTag.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<template>
<div class="SearchTag mb-1 mr-1 inline-block">
<div class="flex align-items-center gap-0">
<div v-if="showRealm" class="p-1 px-2 bg-white border-900">
{{ parts.realm }}
</div>
<div class="p-1 px-2 text-base bg-black-alpha-10 border-900">
<div class="p-1 px-2 text-base bg-black-alpha-10 border-900" v-tooltip="tag.id">
{{ parts.topic }}
</div>
<div v-if="parts.detail" class="p-1 px-2 bg-black-alpha-90 text-white border-900">
Expand Down Expand Up @@ -48,6 +45,31 @@ const translate = (prefix: string, value: string | number | null): string | null
if (value === null) {
return null
}
if (prefix.endsWith('ableton:version:')) {
return value.toString()
}
if (prefix.endsWith('time-weekday:')) {
return t('datetime.weekday.' + value.toString())
}
if (prefix.endsWith('time-month:')) {
return t('datetime.month.' + value.toString())
}
if (prefix.endsWith('time-quarter:')) {
return t('datetime.quarter.' + value.toString())
}
if (prefix.endsWith('zodiac-western:')) {
return t('datetime.zodiac-western.' + value.toString())
}
if (prefix.endsWith('zodiac-chinese:')) {
return t('datetime.zodiac-chinese.' + value.toString())
}
if (typeof value === 'number') {
return value.toString()
}
Expand All @@ -65,7 +87,7 @@ const parts = computed(() => {
realm: translate('tags.', p[0] ?? null),
topic: translate('tags.' + p[0] + ':', p[1] ?? null),
detail: translate('tags.' + p[0] + ':' + p[1] + ':', p[2] ?? null),
extra: p[3]
extra: translate('tags.' + p[0] + ':' + p[1] + ':' + p[2] + ':', p[3] ?? null)
}
})
</script>
Expand Down
75 changes: 75 additions & 0 deletions frontend/src/locales/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,60 @@ app:
status:
processing: Dateien werden verarbeitet

datetime:
weekday:
0: Sonntag
1: Montag
2: Dienstag
3: Mittwoch
4: Donnerstag
5: Freitag
6: Samstag
month:
1: Januar
2: Februar
3: März
4: April
5: Mai
6: Juni
7: Juli
8: August
9: September
10: Oktober
11: November
12: Dezember
quarter:
1: Q1
2: Q2
3: Q3
4: Q4
zodiac-western:
aries: Widder
taurus: Stier
gemini: Zwillinge
cancer: Krebs
leo: Löwe
virgo: Jungfrau
libra: Waage
scorpio: Skorpion
sagittarius: Schütze
capricorn: Steinbock
aquarius: Wassermann
pisces: Fische
zodiac-chinese:
rat: Ratte
ox: Ochse
tiger: Tiger
rabbit: Hase
dragon: Drache
snake: Schlange
horse: Pferd
goat: Ziege
monkey: Affe
rooster: Hahn
dog: Hund
pig: Schwein

donate:
title:
short: Spende
Expand Down Expand Up @@ -48,23 +102,44 @@ error:

tags:
sys: System

sys:ableton: Ableton
sys:ableton:version: Version

sys:live-set: Live Set
sys:live-set:tempo: Tempo
sys:live-set:has-audio-track: Hat Audiospur
sys:live-set:no-audio-track: Keine Audiospur
sys:live-set:has-midi-track: Hat MIDI-Spur
sys:live-set:no-midi-track: Keine MIDI-Spur
sys:live-set:has-midi-audio-tracks: Hat MIDI- und Audiospur

sys:location: Speicherort
sys:location:live-recording: Live Recording
sys:location:user-library: User Library
sys:location:factory-pack: Factory Pack
sys:location:cloud-manager: Cloud Manager
sys:location:trash: Papierkorb
sys:location:dropbox: Dropbox
sys:location:onedrive: OneDrive
sys:location:google-drive: Google Drive
sys:location:elsewhere: Sonstwo

sys:file: Datei
sys:file:btime-year: Erstelltes Jahr
sys:file:btime-month: Erstellter Monat
sys:file:btime-quarter: Erstelltes Quartal
sys:file:btime-weekday: Erstellter Wochentag
sys:file:btime-weekno: Erstellte Woche
sys:file:mtime-year: Geändertes Jahr
sys:file:mtime-month: Geänderter Monat
sys:file:mtime-quarter: Geändertes Quartal
sys:file:mtime-weekday: Geänderter Wochentag
sys:file:mtime-weekno: Geänderte Woche

sys:file:zodiac-western: Westliches Sternzeichen
sys:file:zodiac-chinese: Chinesisches Sternzeichen

app-status:
title: Status der App
description: Zeigt alle aktuellen Informationen zur App-Laufzeit an.
Expand Down
80 changes: 80 additions & 0 deletions frontend/src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,60 @@ app:
status:
processing: Processing files

datetime:
weekday:
0: Sunday
1: Monday
2: Tuesday
3: Wednesday
4: Thursday
5: Friday
6: Saturday
month:
1: January
2: February
3: March
4: April
5: May
6: June
7: July
8: August
9: September
10: October
11: November
12: December
quarter:
1: Q1
2: Q2
3: Q3
4: Q4
zodiac-western:
aries: Aries
taurus: Taurus
gemini: Gemini
cancer: Cancer
leo: Leo
virgo: Virgo
libra: Libra
scorpio: Scorpio
sagittarius: Sagittarius
capricorn: Capricorn
aquarius: Aquarius
pisces: Pisces
zodiac-chinese:
rat: Rat
ox: Ox
tiger: Tiger
rabbit: Rabbit
dragon: Dragon
snake: Snake
horse: Horse
goat: Goat
monkey: Monkey
rooster: Rooster
dog: Dog
pig: Pig

donate:
title:
short: Donate
Expand Down Expand Up @@ -48,23 +102,44 @@ error:

tags:
sys: System

sys:ableton: Ableton
sys:ableton:version: Version

sys:live-set: Live Set
sys:live-set:tempo: Tempo
sys:live-set:has-audio-track: Has audio track
sys:live-set:no-audio-track: No audio track
sys:live-set:has-midi-track: Has MIDI track
sys:live-set:no-midi-track: No MIDI track
sys:live-set:has-midi-audio-tracks: Has MIDI and audio tracks

sys:location: Location
sys:location:live-recording: Live Recording
sys:location:user-library: User Library
sys:location:factory-pack: Factory Pack
sys:location:cloud-manager: Cloud Manager
sys:location:trash: Trash
sys:location:dropbox: Dropbox
sys:location:onedrive: OneDrive
sys:location:google-drive: Google Drive
sys:location:elsewhere: Elsewhere

sys:file: File
sys:file:btime-year: Creation year
sys:file:btime-month: Creation month
sys:file:btime-quarter: Creation quarter
sys:file:btime-weekday: Creation weekday
sys:file:btime-weekno: Creation week number
sys:file:mtime-year: Modified year
sys:file:mtime-month: Modified month
sys:file:mtime-quarter: Modified quarter
sys:file:mtime-weekday: Modified weekday
sys:file:mtime-weekno: Modified week number

sys:file:zodiac-western: Western zodiac
sys:file:zodiac-chinese: Chinese zodiac

app-status:
title: App status
description: Contains information about the application and its current status.
Expand Down Expand Up @@ -116,6 +191,11 @@ tag-overview:
description: >-
Contains tags that are related to the location of the
file within the scanned drives and folders.
file:
title: File related tags
description: >-
Contains tags that are related to the file itself.
live-set:
title: Live Set related tags
description: >-
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/stores/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ export const useStatStore = defineStore('stats', () => {
const audioTrackCount = ref(0)

const updateMetrics = (values: { [key: string]: number }) => {
console.log('Updating metrics')

for (const [k, v] of Object.entries(values)) {
switch (k) {
case 'files_valid':
Expand Down
2 changes: 2 additions & 0 deletions service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ go 1.21
require (
fyne.io/fyne/v2 v2.4.1
github.com/blevesearch/bleve/v2 v2.3.10
github.com/djherbis/times v1.6.0
github.com/duaneking/gozodiacs v0.0.0-20230703202012-0830be15d5c0
github.com/gin-contrib/cors v1.4.0
github.com/gin-contrib/logger v0.2.6
github.com/gin-contrib/static v0.0.1
Expand Down
Loading

0 comments on commit 114d069

Please sign in to comment.