55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > TinyIce Admin</ title >
77 < script src ="/assets/js/lucide.min.js "> </ script >
8- < script src ="https://cdn.jsdelivr.net/npm/sortablejs@1.15.0 /Sortable.min.js "> </ script >
8+ < script src ="/assets/js /Sortable.min.js "> </ script >
99 < style >
1010 : root {
1111 --bg : # 0b0f1a ; --surface : # 161b2c ; --surface-hover : # 1e253a ;
@@ -368,6 +368,10 @@ <h2>Provision AutoDJ</h2>
368368 < input type ="checkbox " name ="loop " id ="adj-loop " checked style ="width: auto; ">
369369 < label for ="adj-loop " style ="margin-bottom: 0; "> Loop Playlist</ label >
370370 </ div >
371+ < div class ="form-group " style ="display: flex; align-items: center; gap: 0.5rem; ">
372+ < input type ="checkbox " name ="inject_metadata " id ="adj-metadata " checked style ="width: auto; ">
373+ < label for ="adj-metadata " style ="margin-bottom: 0; "> Inject Metadata (ICY)</ label >
374+ </ div >
371375 < button type ="submit " class ="btn btn-primary " style ="width: 100%; "> Create AutoDJ</ button >
372376 </ form >
373377 </ div >
@@ -391,17 +395,18 @@ <h3 style="margin: 0; display: flex; align-items: center; gap: 0.5rem;">
391395 Dir: < span style ="font-family: monospace; font-size: 0.75rem; "> {{.MusicDir}}</ span >
392396 </ div >
393397 </ div >
394- < div style ="display: flex; gap: 0.5rem; ">
395- < form action ="/admin/player/shuffle " method ="POST ">
396- < input type ="hidden " name ="csrf " value ="{{$.CSRFToken}} ">
397- < input type ="hidden " name ="mount " value ="{{.OutputMount}} ">
398- < button type ="submit " class ="btn {{if .Shuffle}}btn-primary{{else}}btn-outline{{end}} btn-sm " title ="Toggle Shuffle ">
399- < i data-lucide ="shuffle " style ="width: 14px; height: 14px; "> </ i >
400- </ button >
401- </ form >
402- < a href ="/player{{.OutputMount}} " target ="_blank " class ="btn btn-outline btn-sm "> < i data-lucide ="headphones " style ="width: 14px; height: 14px; margin-right: 4px; "> </ i > MONITOR</ a >
403- < form action ="/admin/autodj/toggle " method ="POST ">
404- < input type ="hidden " name ="csrf " value ="{{$.CSRFToken}} ">
398+ < div style ="display: flex; gap: 0.5rem; ">
399+ < form action ="/admin/player/shuffle " method ="POST ">
400+ < input type ="hidden " name ="csrf " value ="{{$.CSRFToken}} ">
401+ < input type ="hidden " name ="mount " value ="{{.OutputMount}} ">
402+ < button type ="submit " class ="btn {{if .Shuffle}}btn-primary{{else}}btn-outline{{end}} btn-sm " title ="Toggle Shuffle ">
403+ < i data-lucide ="shuffle " style ="width: 14px; height: 14px; "> </ i >
404+ </ button >
405+ </ form >
406+ {{if eq .State 1}}
407+ < a href ="/player{{.OutputMount}} " target ="_blank " class ="btn btn-outline btn-sm "> < i data-lucide ="headphones " style ="width: 14px; height: 14px; margin-right: 4px; "> </ i > MONITOR</ a >
408+ {{end}}
409+ < form action ="/admin/autodj/toggle " method ="POST "> < input type ="hidden " name ="csrf " value ="{{$.CSRFToken}} ">
405410 < input type ="hidden " name ="mount " value ="{{.OutputMount}} ">
406411 < button type ="submit " class ="btn {{if eq .State 1}}btn-warning{{else}}btn-primary{{end}} btn-sm ">
407412 {{if eq .State 1}}STOP{{else}}START{{end}}
@@ -441,7 +446,7 @@ <h3 style="margin: 0; display: flex; align-items: center; gap: 0.5rem;">
441446 < div style ="margin-bottom: 1rem; ">
442447 < div class ="label " style ="font-size: 0.65rem; color: var(--primary); margin-bottom: 0.5rem; letter-spacing: 1px; "> UP NEXT (QUEUE)</ div >
443448 < div style ="display: flex; flex-direction: column; gap: 0.4rem; ">
444- {{range $qidx, $qfile := .Queue }}
449+ {{range $qidx, $qfile := .GetQueueNames }}
445450 < div style ="display: flex; justify-content: space-between; align-items: center; background: rgba(56, 189, 248, 0.05); padding: 0.5rem; border-radius: 4px; border: 1px dashed var(--primary-glow); ">
446451 < span style ="font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "> {{$qfile}}</ span >
447452 < form action ="/admin/player/queue " method ="POST ">
@@ -460,18 +465,20 @@ <h3 style="margin: 0; display: flex; align-items: center; gap: 0.5rem;">
460465 < div class ="label " style ="font-size: 0.65rem; color: var(--text-dim); margin-bottom: 0.5rem; letter-spacing: 1px; "> PLAYLIST (DRAG TO REORDER)</ div >
461466 < div class ="playlist-sortable " data-mount ="{{.OutputMount}} " style ="max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; ">
462467 {{$current := .CurrentPos}}
463- {{range $idx, $file := .Playlist }}
468+ {{range $idx, $file := .GetPlaylistNames }}
464469 < div class ="playlist-item {{if and (not $.Shuffle) (eq $idx $current)}}active{{end}} " data-index ="{{$idx}} " style ="display: flex; justify-content: space-between; align-items: center; background: var(--bg); padding: 0.6rem; border-radius: 4px; cursor: grab; border: 1px solid transparent; ">
465470 < div style ="display: flex; align-items: center; gap: 0.75rem; overflow: hidden; ">
466471 < i data-lucide ="grip-vertical " style ="width: 14px; height: 14px; color: var(--border); "> </ i >
467- < span style ="font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; "> {{$file}}</ span >
472+ < span style ="font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; " title ="{{$file}} ">
473+ {{$file}}
474+ </ span >
468475 </ div >
469476 < div style ="display: flex; gap: 0.5rem; ">
470477 < form action ="/admin/player/queue " method ="POST ">
471478 < input type ="hidden " name ="csrf " value ="{{$.CSRFToken}} ">
472479 < input type ="hidden " name ="mount " value ="{{$.OutputMount}} ">
473480 < input type ="hidden " name ="action " value ="add ">
474- < input type ="hidden " name ="path " value ="{{$file }} ">
481+ < input type ="hidden " name ="path " value ="{{index $.Playlist $idx }} ">
475482 < button type ="submit " class ="btn btn-outline btn-sm " style ="padding: 0.2rem 0.4rem; " title ="Add to Queue "> < i data-lucide ="list-plus " style ="width: 14px; height: 14px; "> </ i > </ button >
476483 </ form >
477484 </ div >
0 commit comments