wvffle 2023-01-19 21:23:09 +00:00 zatwierdzone przez Marge
rodzic 91c6935e2d
commit d7255bf293
2 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -213,7 +213,7 @@ const uploadedFilesById = computed(() => uploadedFiles.value.reduce((acc: Record
//
// Metadata
//
type Metadata = Pick<Track, 'title' | 'description' | 'position' | 'tags'> & { cover: string }
type Metadata = Pick<Track, 'title' | 'position' | 'tags'> & { cover: string | null, description: string }
const uploadImportData = reactive({} as Record<string, Metadata>)
const audioMetadata = reactive({} as Record<string, Record<string, string>>)
const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>)

Wyświetl plik

@ -6,14 +6,14 @@ import { reactive, computed, watch } from 'vue'
import TagsSelector from '~/components/library/TagsSelector.vue'
import AttachmentInput from '~/components/common/AttachmentInput.vue'
type Values = Pick<Track, 'title' | 'description' | 'position' | 'tags'> & { cover: string }
type Values = Pick<Track, 'title' | 'position' | 'tags'> & { cover: string | null, description: string }
interface Events {
(e: 'update:values', values: Values): void
}
interface Props {
upload: Upload
values: Values | null
values: Partial<Values> | null
}
const emit = defineEmits<Events>()
@ -23,7 +23,10 @@ const props = withDefaults(defineProps<Props>(), {
const newValues = reactive<Values>({
description: '',
...(props.values ?? props.upload.import_metadata ?? {}) as Values
title: '',
tags: [],
cover: null,
...(props.values ?? props.upload.import_metadata ?? {})
})
const isLoading = computed(() => !props.upload)