add DEBUG-43 diagnostic logging to frontend views
Add console.warn logging with [DEBUG-43] prefix to: - handleAlbumClick: album ID, API response, converted data, tracks count - AlbumDetailView onMount: album state and track availability - HomeView fetchFeaturedAlbumsSingle: genre ID and result count Uses console.warn for better WebKitGTK log visibility.
This commit is contained in:
1 parent
a75f957cc9
commit
1dc61b50c5
3 files changed
+21
-6
No files matched your search
@@ -246,6 +246,15 @@
|
|||||||
|
|
||||||
// Check if album is in favorites on mount
|
// Check if album is in favorites on mount
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
console.warn('[DEBUG-43] AlbumDetailView mounted:', {
|
||||||
|
albumId: album?.id, albumTitle: album?.title,
|
||||||
|
tracksCount: album?.tracks?.length ?? 0,
|
||||||
|
hasTracks: Array.isArray(album?.tracks) && album.tracks.length > 0
|
||||||
|
});
|
||||||
|
if (!album?.tracks || album.tracks.length === 0) {
|
||||||
|
console.error('[DEBUG-43] AlbumDetailView mounted with no tracks');
|
||||||
|
}
|
||||||
|
|
||||||
let unsubscribe: (() => void) | null = null;
|
let unsubscribe: (() => void) | null = null;
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -472,14 +472,16 @@
|
|||||||
|
|
||||||
async function fetchFeaturedAlbumsSingle(featuredType: string, limit: number, genreId?: number): Promise<AlbumCardData[]> {
|
async function fetchFeaturedAlbumsSingle(featuredType: string, limit: number, genreId?: number): Promise<AlbumCardData[]> {
|
||||||
try {
|
try {
|
||||||
|
console.warn(`[DEBUG-43] fetchFeaturedAlbums: type=${featuredType}, limit=${limit}, genreId=${genreId ?? 'null'}`);
|
||||||
const response = await invoke<FeaturedAlbumsResponse>('get_featured_albums', {
|
const response = await invoke<FeaturedAlbumsResponse>('get_featured_albums', {
|
||||||
featuredType,
|
featuredType,
|
||||||
limit,
|
limit,
|
||||||
genreId: genreId ?? null
|
genreId: genreId ?? null
|
||||||
});
|
});
|
||||||
|
console.warn(`[DEBUG-43] fetchFeaturedAlbums result: type=${featuredType}, returned=${response.items.length} albums`);
|
||||||
return response.items.map(toAlbumCard);
|
return response.items.map(toAlbumCard);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Failed to fetch ${featuredType}:`, err);
|
console.error(`[DEBUG-43] Failed to fetch ${featuredType}:`, err);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -579,20 +579,24 @@
|
|||||||
|
|
||||||
async function handleAlbumClick(albumId: string) {
|
async function handleAlbumClick(albumId: string) {
|
||||||
try {
|
try {
|
||||||
console.log('[Album] handleAlbumClick called with albumId:', albumId, 'type:', typeof albumId);
|
console.warn('[DEBUG-43] Album click: albumId=', albumId, 'type:', typeof albumId);
|
||||||
showToast($t('toast.loadingAlbum'), 'info');
|
showToast($t('toast.loadingAlbum'), 'info');
|
||||||
const album = await invoke<QobuzAlbum>('get_album', { albumId });
|
const album = await invoke<QobuzAlbum>('get_album', { albumId });
|
||||||
console.log('[Album] API response received, id:', album?.id, 'title:', album?.title, 'tracks:', album?.tracks?.items?.length);
|
console.warn('[DEBUG-43] Album API response: id=', album?.id, 'title=', album?.title, 'tracksCount=', album?.tracks?.items?.length ?? 0);
|
||||||
|
|
||||||
const converted = convertQobuzAlbum(album);
|
const converted = convertQobuzAlbum(album);
|
||||||
console.log('[Album] Converted album, id:', converted?.id, 'tracks:', converted?.tracks?.length);
|
console.warn('[DEBUG-43] Converted album: id=', converted?.id, 'tracksCount=', converted?.tracks?.length ?? 0);
|
||||||
|
|
||||||
if (!converted || !converted.id) {
|
if (!converted || !converted.id) {
|
||||||
console.error('[Album] convertQobuzAlbum returned invalid data:', converted);
|
console.error('[DEBUG-43] convertQobuzAlbum returned invalid data:', converted);
|
||||||
showToast($t('toast.failedLoadAlbum'), 'error');
|
showToast($t('toast.failedLoadAlbum'), 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!converted.tracks || converted.tracks.length === 0) {
|
||||||
|
console.warn('[DEBUG-43] Album has no tracks - may render blank');
|
||||||
|
}
|
||||||
|
|
||||||
selectedAlbum = converted;
|
selectedAlbum = converted;
|
||||||
navigateTo('album');
|
navigateTo('album');
|
||||||
hideToast();
|
hideToast();
|
||||||
@@ -604,7 +608,7 @@
|
|||||||
albumArtistAlbums = [];
|
albumArtistAlbums = [];
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[Album] Failed to load album:', err);
|
console.error('[DEBUG-43] Failed to load album:', err);
|
||||||
showToast($t('toast.failedLoadAlbum'), 'error');
|
showToast($t('toast.failedLoadAlbum'), 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user