Compare commits

..

No commits in common. "2efed23afd334d00ca4a287fabda7b70fea86ca9" and "a34634e00ff2d72a57097c1ef4635df80a3deec8" have entirely different histories.

3 changed files with 2 additions and 16 deletions

View File

@ -103,7 +103,6 @@ const emit = defineEmits<{
delete: [path: string]
share: [path: string, name: string, isDir: boolean]
preview: [path: string]
play: [path: string, name: string]
}>()
const cloudStore = useCloudStore()
@ -123,10 +122,8 @@ const downloadHref = computed(() => cloudStore.downloadUrl(props.item.path))
function handleClick() {
if (props.item.isDir) {
emit('navigate', props.item.path)
} else if (isAudio.value) {
// Music goes to the global bottom-bar player, not the lightbox.
emit('play', props.item.path, props.item.name)
} else if (isImage.value || isVideo.value) {
} else if (isImage.value || isVideo.value || isAudio.value) {
// MediaLightbox handles all three media kinds.
emit('preview', props.item.path)
} else {
// Non-media files open by downloading a click should always act on the file.

View File

@ -53,7 +53,6 @@
:item="item"
@navigate="$emit('navigate', $event)"
@delete="$emit('delete', $event)"
@play="(path, name) => $emit('play', path, name)"
@share="(path, name, isDir) => $emit('share', path, name, isDir)"
@preview="$emit('preview', $event)"
/>

View File

@ -93,7 +93,6 @@
:item="r.item"
@delete="handleDelete"
@share="handleShare"
@play="handlePlay"
@preview="(p: string) => handlePreview(p, searchMineItems)"
/>
<button
@ -142,7 +141,6 @@
:item="item"
@delete="handleDelete"
@share="handleShare"
@play="handlePlay"
@preview="(p: string) => handlePreview(p, filteredMyFiles)"
/>
</div>
@ -361,7 +359,6 @@ import { useCloudStore } from '../stores/cloud'
import { fileBrowserClient, type FileBrowserItem } from '@/api/filebrowser-client'
import { rpcClient } from '@/api/rpc-client'
import { getFileCategory } from '../composables/useFileType'
import { useAudioPlayer } from '../composables/useAudioPlayer'
import FileCard from '../components/cloud/FileCard.vue'
import ShareModal from '../components/cloud/ShareModal.vue'
import MediaLightbox from '../components/cloud/MediaLightbox.vue'
@ -369,7 +366,6 @@ import MediaLightbox from '../components/cloud/MediaLightbox.vue'
const router = useRouter()
const store = useAppStore()
const cloudStore = useCloudStore()
const audioPlayer = useAudioPlayer()
const sectionCounts = ref<Record<string, number>>({})
const countsLoading = ref(false)
@ -569,12 +565,6 @@ function handleShare(path: string, name: string, isDir: boolean) {
shareTarget.value = { path, name, isDir }
}
/** Music opens in the global bottom-bar player (GlobalAudioPlayer in App.vue). */
async function handlePlay(path: string, name: string) {
const url = await cloudStore.streamUrl(path)
audioPlayer.play(url, name)
}
function handlePreview(path: string, context: FileBrowserItem[]) {
// MediaLightbox filters to media internally; index within that filtered list.
const mediaItems = context.filter(item => {