Restructure Settings nav, modernize import page, dedup/genres UX polish
Settings is now one top-nav entry with Credentials and Jobs as sidebar sub-pages (jobs moved from /jobs to /settings/jobs). Manual import page replaces the bare file input and free-text filename field with a drag-drop dropzone and a proper file-picker table. Genres page drops the "force" checkbox for two explicit buttons (Preview / Fix genres now). Dedup's "Scan now" runs both the file-naming and acoustic passes together, and the table labels which pass caught each candidate instead of showing the raw pass name. .btn-ghost gets a visible border so it reads as a real button next to Delete/Danger actions instead of looking unaligned. Job names throughout the UI are now human-readable instead of raw job_key strings. Also includes the fpcalc exit-code fix from earlier (fingerprint index was discarding valid fingerprints on files with a benign decode warning).
This commit is contained in:
@@ -4,60 +4,74 @@
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Manual import</h1>
|
||||
<p class="subtitle muted">Drop files into <span class="mono">import-me/</span> and run them through the pipeline.</p>
|
||||
<p class="subtitle muted">For anything outside the normal playlist flow: a stray download, a one-off track, a Bandcamp leftover.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if request.query_params.get('run_id') %}
|
||||
<div class="notice success">Import job started (run id {{ request.query_params.get('run_id') }}). Check the Jobs page for progress.</div>
|
||||
<div class="notice success">Import started (run #{{ request.query_params.get('run_id') }}). Check <a href="/settings/jobs">Jobs</a> for progress.</div>
|
||||
{% endif %}
|
||||
|
||||
<h2>Upload a file into import-me/</h2>
|
||||
<div class="panel" style="max-width:560px;">
|
||||
<form method="post" action="/import/upload" enctype="multipart/form-data">
|
||||
<div class="field wide">
|
||||
<input type="file" name="file" required>
|
||||
</div>
|
||||
<button type="submit" class="btn">Upload</button>
|
||||
<div class="panel dropzone-panel" x-data="{ over: false }">
|
||||
<form method="post" action="/import/upload" enctype="multipart/form-data" x-ref="uploadForm">
|
||||
<label class="dropzone" :class="{ dragover: over }"
|
||||
@dragover.prevent="over = true"
|
||||
@dragleave.prevent="over = false"
|
||||
@drop.prevent="over = false">
|
||||
<svg class="dropzone-icon" width="30" height="30" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 15V4M12 4l-4 4M12 4l4 4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span class="dropzone-title">Drop a file here, or click to browse</span>
|
||||
<span class="dropzone-hint">Goes straight into import-me/</span>
|
||||
<input type="file" name="file" required @change="$refs.uploadForm.submit()">
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2>Contents of import-me/</h2>
|
||||
{% if contents %}
|
||||
<ul class="chip-list">
|
||||
{% for name in contents %}
|
||||
<li>{{ name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="muted">(empty)</p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Run import</h2>
|
||||
<div class="panel" style="max-width:560px;">
|
||||
<form method="post" action="/import/run">
|
||||
<div class="field">
|
||||
<label for="source">File/subdir</label>
|
||||
<input type="text" id="source" name="source" list="import-contents">
|
||||
<span class="hint">Blank = import everything above.</span>
|
||||
<datalist id="import-contents">
|
||||
{% for name in contents %}
|
||||
<option value="{{ name }}">
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="playlist_name">Playlist tag (optional)</label>
|
||||
<select id="playlist_name" name="playlist_name">
|
||||
<option value="">(none)</option>
|
||||
<div class="page-header" style="margin-top:2.5rem; margin-bottom:1rem;">
|
||||
<div>
|
||||
<h2 style="margin:0;">Waiting to import</h2>
|
||||
<p class="subtitle muted">{{ contents | length }} item{{ "s" if contents | length != 1 else "" }} in import-me/.</p>
|
||||
</div>
|
||||
{% if contents %}
|
||||
<div class="actions">
|
||||
<form method="post" action="/import/run" class="inline" style="display:flex; gap:0.6rem; align-items:center;">
|
||||
<select name="playlist_name" title="Playlist tag (optional)" style="width:auto;">
|
||||
<option value="">No playlist tag</option>
|
||||
{% for p in playlists %}
|
||||
<option value="{{ p.name }}">{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Import everything</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Import</button>
|
||||
</form>
|
||||
<div class="table-wrap scroll">
|
||||
<table>
|
||||
<thead><tr><th>Name</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for name in contents %}
|
||||
<tr>
|
||||
<td class="mono">{{ name }}</td>
|
||||
<td class="actions-cell">
|
||||
<form method="post" action="/import/run" class="inline">
|
||||
<input type="hidden" name="source" value="{{ name }}">
|
||||
<button type="submit" class="btn btn-sm btn-ghost">Import this</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr class="empty-row"><td colspan="2">
|
||||
<div class="empty-state">
|
||||
<span class="sparkle" style="position:relative; display:inline-block; margin-bottom:0.5rem;"></span>
|
||||
<p class="muted" style="margin:0;">Nothing waiting. Drop a file above to get started.</p>
|
||||
</div>
|
||||
</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user