fix: fix tsc linter

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2307>
This commit is contained in:
wvffle 2023-01-19 21:23:09 +00:00 committed by Marge
parent 91c6935e2d
commit d7255bf293
2 changed files with 7 additions and 4 deletions

View File

@ -213,7 +213,7 @@ const uploadedFilesById = computed(() => uploadedFiles.value.reduce((acc: Record
// //
// Metadata // 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 uploadImportData = reactive({} as Record<string, Metadata>)
const audioMetadata = reactive({} as Record<string, Record<string, string>>) const audioMetadata = reactive({} as Record<string, Record<string, string>>)
const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>) const uploadData = reactive({} as Record<string, { import_metadata: Metadata }>)

View File

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