- Timestamp:
- 06/30/2026 03:06:32 PM (2 months ago)
- Branches:
- main
- Children:
- 4d1aefb
- Parents:
- d4d8f9d
- Location:
- src/views
- Files:
-
- 2 edited
-
pages/admin-audio.ejs (modified) (1 diff)
-
partials/track-editor.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/admin-audio.ejs
rd4d8f9d r98a1990 1 1 <div class="container ax-page"> 2 2 3 <p><a href="/admin" class="btn">← <%= t('nav.admin') %></a> </p>3 <p><a href="/admin" class="btn">← <%= t('nav.admin') %></a> <a href="/admin/playlists" class="btn">🎵 <%= t('admin.b_playlists') %></a></p> 4 4 <header class="ax-header"> 5 5 <div> -
src/views/partials/track-editor.ejs
rd4d8f9d r98a1990 440 440 441 441 <div class="te-field"> 442 <span>Audiobestand</span> 443 <div class="te-cover-btn-row"> 444 <input type="file" id="te-audio-file" accept="audio/*,.mp3,.wav,.m4a,.flac,.ogg,.aac" hidden> 445 <button type="button" class="te-cover-btn" id="te-audio-pick">${track.stream_url ? '🔁 Vervang audiobestand' : '🎵 Audiobestand kiezen'}</button> 446 <span class="te-cover-status" id="te-audio-status"></span> 447 </div> 448 </div> 449 450 <div class="te-field"> 442 451 <span>Cover</span> 443 452 <div class="te-cover-row"> … … 636 645 } 637 646 647 // ── Replace the audio file of this track ────────────────── 648 const aPick = $('#te-audio-pick'); 649 const aFile = $('#te-audio-file'); 650 const aStatus = $('#te-audio-status'); 651 if (aPick && aFile) { 652 aPick.addEventListener('click', () => aFile.click()); 653 aFile.addEventListener('change', async (e) => { 654 const f = e.target.files && e.target.files[0]; 655 aFile.value = ''; 656 if (!f) return; 657 aStatus.textContent = '⏳ Converteren… (kan even duren)'; aStatus.className = 'te-cover-status'; 658 aPick.disabled = true; 659 try { 660 const fd = new FormData(); 661 fd.append('audio', f); 662 const j = await api('POST', '/admin/audio/api/' + encodeURIComponent(id) + '/replace-audio', fd); 663 if (!j.ok) throw new Error(j.error || 'mislukt'); 664 aStatus.textContent = '✓ Vervangen'; aStatus.className = 'te-cover-status is-ok'; 665 track.stream_url = j.stream_url || track.stream_url; 666 if (j.duration) { const d = $('#te-duration'); if (d) d.value = j.duration; } 667 } catch (err) { 668 aStatus.textContent = 'Mislukt: ' + err.message; aStatus.className = 'te-cover-status is-error'; 669 } finally { aPick.disabled = false; } 670 }); 671 } 672 638 673 // ── Insert © symbol into the credit field ───────────────── 639 674 const copyrBtn = $('#te-credit-copyr');
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)