🚀 v0.3.41 — Add NoMedia playback state handling & improve Chromecast logging

- Bump version to v0.3.41
- Add comprehensive debug logging in Chromecast renderer for app/media status detection (app name, player state)
- Implement robust `NoMedia` playback handling for auto advancing on track end (especially important Chromecast behavior)
- Reorganize imports in `musicrenderer.rs` for clarity
- Fix minor import ordering and remove unused blank line
This commit is contained in:
2026-04-03 22:42:12 +02:00
parent 3a3dc1727f
commit 57995e0bdf
3 changed files with 291 additions and 20 deletions

View File

@@ -5,6 +5,7 @@
import { ref, computed } from 'vue'
import { api } from '../services/pmocontrol/api'
import { useSSE } from './useSSE'
import { apiCache } from './apiCache'
import type {
MediaServerSummary,
ContainerEntry,
@@ -28,11 +29,6 @@ const currentPath = ref<BreadcrumbItem[]>([])
const searchResults = ref<BrowseState | null>(null)
const searchQuery = ref<string>('')
// Timestamps
const lastFetch = {
servers: 0
}
const CACHE_DURATION_MS = 2000
// Initialiser SSE une seule fois via le composable centralisé
@@ -122,19 +118,20 @@ export function useMediaServers() {
// Fetch servers list
async function fetchServers(force = false) {
const now = Date.now()
if (!force && now - lastFetch.servers < CACHE_DURATION_MS) {
return
}
try {
loading.value = true
error.value = null
const data = await api.getServers()
// Utiliser le cache API centralisé
const data = await apiCache.fetch(
'/servers',
undefined,
() => api.getServers(),
{ force, ttl: CACHE_DURATION_MS }
)
serversCache.value.clear()
data.forEach(s => serversCache.value.set(s.id, s))
lastFetch.servers = now
} catch (e) {
error.value = e instanceof Error ? e.message : 'Erreur fetch servers'
console.error('[useMediaServers] Erreur fetch:', e)