Add playlistTitle

This commit is contained in:
2026-01-08 19:59:00 +05:00
parent 9984bb804a
commit bd878fceab
3 changed files with 14 additions and 5 deletions

View File

@ -1,16 +1,16 @@
<template> <template>
<SingleUploadEntry v-if="entry.type === 'TRACK'" :title="(entry as SingleTrackProgressAllOf).title || ''" :size="''" <SingleUploadEntry v-if="entry.type === 'TRACK'" :title="(entry as SingleTrackProgressAllOf).title || ''" :size="''"
:format="(entry as SingleTrackProgressAllOf).format || ''" /> :format="(entry as SingleTrackProgressAllOf).format || ''" />
<PlaylistUploadEntry v-if="entry.type === 'PLAYLIST'" title="" <PlaylistUploadEntry v-if="entry.type === 'PLAYLIST'" :title="(entry as PlaylistProgressAllOf).playlistTitle || ''"
:trackCount="(entry as PlaylistProgressAllOf).trackCount" :trackCount="(entry as PlaylistProgressAllOf).trackCount"
:ytdlnStdout="(entry as PlaylistProgressAllOf).ytdlnStdout || ''" :ytdlnStdout="(entry as PlaylistProgressAllOf).ytdlnStdout || ''"
:status="(entry as PlaylistProgressAllOf).status || 'LOADING'" /> :status="(entry as PlaylistProgressAllOf).status || 'LOADING'" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import type { PlaylistProgressAllOf, PlaylistProgressAllOfStatus, SingleTrackProgressAllOf, StreamProgress200Item } from '~/composeables/api/models'; import type { PlaylistProgressAllOf, SingleTrackProgressAllOf, StreamProgress200Item } from '~/composeables/api/models';
import SingleUploadEntry from './SingleUploadEntry.vue';
import PlaylistUploadEntry from './PlaylistUploadEntry.vue'; import PlaylistUploadEntry from './PlaylistUploadEntry.vue';
import SingleUploadEntry from './SingleUploadEntry.vue';
interface Props { interface Props {
entry: StreamProgress200Item entry: StreamProgress200Item

View File

@ -10,5 +10,6 @@ export type PlaylistProgressAllOf = {
ytdlnStdout?: string; ytdlnStdout?: string;
overallProgress?: number; overallProgress?: number;
trackCount?: number; trackCount?: number;
playlistTitle?: string;
status?: PlaylistProgressAllOfStatus; status?: PlaylistProgressAllOfStatus;
}; };

View File

@ -18,6 +18,15 @@ const currentPlaylistStore = useCurrentPlaylistStore();
const progressEntries = ref<Map<string, StreamProgress200Item>>(new Map()); const progressEntries = ref<Map<string, StreamProgress200Item>>(new Map());
let listener: EventSourceListener<StreamProgress200Item> | null = null; let listener: EventSourceListener<StreamProgress200Item> | null = null;
const sortedProgressEntries = computed(() => {
return Array.from(progressEntries.value.values())
.sort((a, b) => {
const timeA = a.timestamp || 0;
const timeB = b.timestamp || 0;
return timeB - timeA;
});
});
const unwatch = watch(() => currentPlaylistStore.id, (newId, oldId) => { const unwatch = watch(() => currentPlaylistStore.id, (newId, oldId) => {
if (newId !== -1 && newId !== oldId) { if (newId !== -1 && newId !== oldId) {
listenImports(); listenImports();
@ -91,8 +100,7 @@ onUnmounted(() => {
Uploaded files Uploaded files
</h3> </h3>
<div class="space-y-2"> <div class="space-y-2">
<UploadEntry v-for="entry in Array.from(progressEntries.values())" :key="entry.id" <UploadEntry v-for="entry in sortedProgressEntries" :key="entry.id" :entry="entry" />
:entry="entry" />
<Empty class="border border-dashed" v-if="progressEntries.size === 0"> <Empty class="border border-dashed" v-if="progressEntries.size === 0">
<EmptyHeader> <EmptyHeader>
<EmptyMedia variant="icon"> <EmptyMedia variant="icon">