Dashboard detail, library filtering/pagination, simplified playlist times,
job descriptions Dashboard: format breakdown (FLAC/MP3/etc. counts), approximate library size (bitrate*length/8, same approximation `beet stats` itself uses -- verified to match its "100.5 GiB" output exactly against the real library), and a credential auth-state summary per scope (configured y/n plus, for Bandcamp, cookie expiry parsed locally from the stored cookie jar -- deliberately not a live network probe like pipeline-status.sh's Qobuz check, since this renders on every dashboard load). Library: was one unfiltered page dumping all 4072 tracks. Added search (artist/title/album), playlist and format filter dropdowns, and real SQL-level pagination (LIMIT/OFFSET, not fetch-everything-then-slice). beets_service gained count_items()/distinct_formats() to support this. Playlists: cron_expr is still the stored/scheduled representation, but the UI now shows and edits a plain daily time picker instead of raw cron syntax -- every playlist schedule today is a simple daily HH:MM anyway. playlist_service.cron_to_time()/time_to_cron() convert at the router boundary; verified round-trip against all real playlist cron values. Jobs: each maintenance job now shows a short one-line description of what it actually does (MAINTENANCE_JOB_DESCRIPTIONS), and "next run" is formatted consistently with playlists' time style (HH:MM, with a day qualifier for non-today runs -- maintenance jobs can be weekly/monthly, unlike playlists' plain daily schedule). Verified end-to-end against the real production data (4072 tracks, 100.5 GiB, real credentials): stats/format-breakdown/search/pagination all correct, all 7 credential scopes report configured with Bandcamp's real cookie expiry (325 days), and a full authenticated page-render sweep (dashboard, library with every filter combination, playlist detail, jobs) all returned 200 with no template errors.
This commit is contained in:
@@ -24,8 +24,38 @@
|
||||
<div class="stat-value">{{ stats.groupings | length }}</div>
|
||||
<div class="stat-label">Distinct groupings</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-value">{{ total_size_human }}</div>
|
||||
<div class="stat-label">Approx. library size</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>File formats</h2>
|
||||
{% if stats.formats %}
|
||||
<ul class="chip-list">
|
||||
{% for f in stats.formats %}
|
||||
<li>{{ f.format }} <span class="muted">× {{ f.count }}</span></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="muted">No format data yet.</p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Credential status</h2>
|
||||
<ul class="chip-list">
|
||||
{% for a in auth_states %}
|
||||
<li>
|
||||
{% if a.configured %}<span class="badge badge-success">set</span>{% else %}<span class="badge badge-muted">unset</span>{% endif %}
|
||||
{{ a.scope }}
|
||||
{% if a.days_left is defined %}
|
||||
{% if a.days_left < 14 %}<span class="badge badge-warning">{{ a.days_left }}d left</span>
|
||||
{% else %}<span class="muted">({{ a.days_left }}d left)</span>{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="/settings/credentials">Manage credentials →</a></p>
|
||||
|
||||
<h2>Recent job runs</h2>
|
||||
<div class="table-wrap scroll">
|
||||
<table>
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
<tbody>
|
||||
{% for job in maintenance_jobs %}
|
||||
<tr>
|
||||
<td class="mono">{{ job.job_key }}</td>
|
||||
<td>
|
||||
<div class="mono">{{ job.job_key }}</div>
|
||||
{% if job.description %}<div class="muted" style="font-size:0.8em; margin-top:0.15rem;" title="{{ job.description }}">{{ job.description }}</div>{% endif %}
|
||||
</td>
|
||||
<td>{% if job.enabled %}<span class="badge badge-success">enabled</span>{% else %}<span class="badge badge-muted">disabled</span>{% endif %}</td>
|
||||
<td class="muted">{{ job.next_run or "—" }}</td>
|
||||
<td class="muted mono">{{ job.next_run }}</td>
|
||||
<td class="actions-cell">
|
||||
<form method="post" action="/jobs/{{ job.job_key }}/run" class="inline">
|
||||
<button type="submit" class="btn btn-sm">Run now</button>
|
||||
|
||||
@@ -3,11 +3,38 @@
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Library{% if grouping %} <span class="muted">— {{ grouping }}</span>{% endif %}</h1>
|
||||
<p class="subtitle muted">Tracks currently imported into beets.</p>
|
||||
<h1>Library</h1>
|
||||
<p class="subtitle muted">{{ total }} track{{ "s" if total != 1 else "" }}{% if grouping or format or q %} matching the filters below{% endif %}.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="get" action="/library" class="panel" style="display:flex; gap:0.75rem; flex-wrap:wrap; align-items:flex-end; max-width:none;">
|
||||
<div class="field">
|
||||
<label for="q">Search</label>
|
||||
<input type="text" id="q" name="q" value="{{ q }}" placeholder="artist, title, album...">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="grouping">Playlist</label>
|
||||
<select id="grouping" name="grouping">
|
||||
<option value="">(any)</option>
|
||||
{% for g in all_groupings %}
|
||||
<option value="{{ g }}" {{ "selected" if g == grouping }}>{{ g }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="format">Format</label>
|
||||
<select id="format" name="format">
|
||||
<option value="">(any)</option>
|
||||
{% for f in all_formats %}
|
||||
<option value="{{ f }}" {{ "selected" if f == format }}>{{ f }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Filter</button>
|
||||
{% if grouping or format or q %}<a class="btn btn-ghost" href="/library">Clear</a>{% endif %}
|
||||
</form>
|
||||
|
||||
<div class="table-wrap scroll">
|
||||
<table>
|
||||
<thead>
|
||||
@@ -26,11 +53,24 @@
|
||||
<tr class="empty-row"><td colspan="5">
|
||||
<div class="empty-state">
|
||||
<span class="sparkle" style="position:relative; display:inline-block; margin-bottom:0.5rem;"></span>
|
||||
<p class="muted" style="margin:0;">No tracks found{% if grouping %} for grouping "{{ grouping }}"{% endif %}.</p>
|
||||
<p class="muted" style="margin:0;">No tracks match{% if grouping or format or q %} these filters{% endif %}.</p>
|
||||
</div>
|
||||
</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if total_pages > 1 %}
|
||||
{% set qs = "&grouping=" + grouping + "&format=" + format + "&q=" + q %}
|
||||
<div class="pagination" style="display:flex; gap:0.5rem; align-items:center; margin-top:1rem;">
|
||||
{% if page > 1 %}
|
||||
<a class="btn btn-sm" href="/library?page={{ page - 1 }}{{ qs }}">← Prev</a>
|
||||
{% endif %}
|
||||
<span class="muted">Page {{ page }} of {{ total_pages }}</span>
|
||||
{% if page < total_pages %}
|
||||
<a class="btn btn-sm" href="/library?page={{ page + 1 }}{{ qs }}">Next →</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -19,8 +19,9 @@
|
||||
<form method="post" action="/playlists/{{ playlist.id }}">
|
||||
<label class="checkbox-field"><input type="checkbox" name="active" value="true" {{ "checked" if playlist.active }}> Active</label>
|
||||
<div class="field">
|
||||
<label for="cron_expr">Cron schedule</label>
|
||||
<input type="text" id="cron_expr" name="cron_expr" value="{{ playlist.cron_expr or '' }}" placeholder="0 1 * * *">
|
||||
<label for="sync_time">Sync time (daily)</label>
|
||||
<input type="time" id="sync_time" name="sync_time" value="{{ sync_time }}">
|
||||
<span class="hint">Leave blank for unscheduled/manual-only.</span>
|
||||
</div>
|
||||
<label class="checkbox-field"><input type="checkbox" name="no_m3u" value="true" {{ "checked" if playlist.no_m3u }}> Skip M3U</label>
|
||||
<div class="field wide">
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
<div class="table-wrap scroll">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Active</th><th>Cron</th><th>No M3U</th><th></th></tr>
|
||||
<tr><th>Name</th><th>Active</th><th>Sync time</th><th>No M3U</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for p in playlists %}
|
||||
<tr>
|
||||
<td><a href="/playlists/{{ p.id }}">{{ p.name }}</a></td>
|
||||
<td>{% if p.active %}<span class="badge badge-success">active</span>{% else %}<span class="badge badge-muted">paused</span>{% endif %}</td>
|
||||
<td class="muted mono">{{ p.cron_expr or "unscheduled" }}</td>
|
||||
<td class="muted mono">{{ sync_times.get(p.id) or "unscheduled" }}</td>
|
||||
<td class="muted">{{ "yes" if p.no_m3u else "no" }}</td>
|
||||
<td class="actions-cell">
|
||||
<form method="post" action="/playlists/{{ p.id }}/delete" class="inline"
|
||||
@@ -51,9 +51,9 @@
|
||||
<input type="text" id="spotify_url" name="spotify_url" required placeholder="https://open.spotify.com/playlist/...">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="cron_expr">Cron schedule</label>
|
||||
<input type="text" id="cron_expr" name="cron_expr" placeholder="0 1 * * *">
|
||||
<span class="hint">5-field cron. Leave blank for unscheduled/manual-only.</span>
|
||||
<label for="sync_time">Sync time (daily)</label>
|
||||
<input type="time" id="sync_time" name="sync_time">
|
||||
<span class="hint">Leave blank for unscheduled/manual-only.</span>
|
||||
</div>
|
||||
<label class="checkbox-field"><input type="checkbox" name="no_m3u" value="true"> Skip M3U generation (e.g. "liked songs")</label>
|
||||
<button type="submit" class="btn btn-primary">Add playlist</button>
|
||||
|
||||
Reference in New Issue
Block a user