feat(web+android): Gesamtdauer mit Stunden, in Android neu
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c7fed82736
commit
37f8f8acac
7 files changed
+50
-7
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { S } from '../state.js';
|
||||
import { esc, toast } from '../utils.js';
|
||||
import { esc, toast, formatGesamtdauer } from '../utils.js';
|
||||
import { api, apiCached, apiIsCached, coverUrl, romajiLookup, dispArtistById, getArtistOverride } from '../api.js';
|
||||
import { makeCard, makeAlbumCard, makeSongItem, mkSection } from '../ui/components.js';
|
||||
import { playQueue } from '../player/player.js';
|
||||
@@ -62,10 +62,10 @@ export async function loadPlaylistDetail(pl) {
|
||||
const full = r.playlist || {};
|
||||
S._currentPlaylist = {...pl, ...full, id: pl.id};
|
||||
const songs = full.entry || [];
|
||||
const totalMin = Math.round(songs.reduce((s,t) => s+(t.duration||0), 0) / 60);
|
||||
const gesamt = songs.reduce((s,t) => s+(t.duration||0), 0);
|
||||
const von = _besitzer({ ...pl, ...full });
|
||||
document.getElementById('playlist-detail-stats').textContent =
|
||||
`${songs.length} Titel · ${totalMin} Min.` + (von ? ` · von ${von}` : '');
|
||||
`${songs.length} Titel · ${formatGesamtdauer(gesamt)}` + (von ? ` · von ${von}` : '');
|
||||
const overviewCard = document.querySelector(`#playlists-grid [data-pl-id="${pl.id}"]`);
|
||||
if (overviewCard) overviewCard.querySelector('.card-sub').textContent =
|
||||
songs.length + ' Titel' + (von ? ' · von ' + von : '');
|
||||
|
||||
Reference in new issue
Block a user