fix:(front/back): revert last commit change and pass baseImportMetadata to fileuploadwidget

This commit is contained in:
Petitminion 2025-04-12 16:33:37 +02:00
parent be11eeee7c
commit 989959f5e3
2 changed files with 9 additions and 5 deletions

View File

@ -768,10 +768,7 @@ class UploadViewSet(
# prevent updating an upload that is already processed # prevent updating an upload that is already processed
qs = qs.filter(import_status="draft") qs = qs.filter(import_status="draft")
if self.action != "retrieve": if self.action != "retrieve":
qs = qs.filter( qs = qs.filter(library__actor=self.request.user.actor)
Q(library__actor=self.request.user.actor)
| Q(library__channel__actor=self.request.user.actor)
)
else: else:
actor = utils.get_actor_from_request(self.request) actor = utils.get_actor_from_request(self.request)
qs = qs.playable_by(actor) qs = qs.playable_by(actor)

View File

@ -291,6 +291,13 @@ const uploadedFilesById = computed(() => uploadedFiles.value.reduce((acc: Record
// //
// Metadata // Metadata
// //
const baseImportMetadata = computed(() => ({
channel: values.channel,
import_status: 'draft',
import_metadata: { license: values.license, album: values.album }
}))
type Metadata = Pick<Track, 'title' | 'position' | 'tags'> & { cover: string | null, description: 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>>)
@ -419,7 +426,6 @@ const publish = async () => {
isLoading.value = true isLoading.value = true
errors.value = [] errors.value = []
try { try {
// Post list of uuids of uploadedFiles to axios action:publish // Post list of uuids of uploadedFiles to axios action:publish
@ -647,6 +653,7 @@ defineExpose({
v-model="files" v-model="files"
:class="['ui', 'button', 'channels']" :class="['ui', 'button', 'channels']"
:channel="selectedChannel.uuid" :channel="selectedChannel.uuid"
:data="baseImportMetadata"
@input-file="beforeFileUpload" @input-file="beforeFileUpload"
> >
<div> <div>