push-sswqtxmyqtlw #83
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4,7 +4,7 @@ version = 4
|
||||
|
||||
[[package]]
|
||||
name = "PMOMusic"
|
||||
version = "0.3.28"
|
||||
version = "0.3.29"
|
||||
dependencies = [
|
||||
"axum 0.8.7",
|
||||
"console-subscriber",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "PMOMusic"
|
||||
version = "0.3.28"
|
||||
version = "0.3.29"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
272
pmoapp/webapp/src/assets/styles/drawers.css
Normal file
272
pmoapp/webapp/src/assets/styles/drawers.css
Normal file
@@ -0,0 +1,272 @@
|
||||
/**
|
||||
* Styles communs pour les drawers (ServerDrawer, RendererDrawer)
|
||||
*
|
||||
* Chaque drawer ajoute uniquement ce qui le différencie :
|
||||
* - position (left/right)
|
||||
* - border (border-right / border-left)
|
||||
* - box-shadow (direction)
|
||||
* - backdrop spécifique (position)
|
||||
*/
|
||||
|
||||
/* ========================================
|
||||
BACKDROP
|
||||
======================================== */
|
||||
|
||||
.drawer-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.35);
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
z-index: 200;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.drawer-backdrop {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
PANNEAU DRAWER
|
||||
======================================== */
|
||||
|
||||
.app-drawer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 50vw;
|
||||
/* Fond opaque — évite la transparence empilée sur d'autres éléments glass */
|
||||
background: rgba(22, 22, 32, 0.96);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
z-index: 201;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
.app-drawer {
|
||||
background: rgba(245, 245, 250, 0.97);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.app-drawer {
|
||||
width: 100vw;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
HEADER
|
||||
======================================== */
|
||||
|
||||
.drawer-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-lg);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
.drawer-header {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.drawer-title-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
color: var(--color-text);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.drawer-title {
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drawer-title.small {
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
/* Bouton fermer */
|
||||
.drawer-close-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast) ease;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.drawer-close-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.drawer-close-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* Bouton retour (ServerDrawer navigation) */
|
||||
.drawer-back-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast) ease;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.drawer-back-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
CONTENU
|
||||
======================================== */
|
||||
|
||||
/* Add class="scrollbar-thin" on elements needing thin scrollbar (see pmocontrol.css) */
|
||||
.drawer-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: var(--spacing-md);
|
||||
}
|
||||
|
||||
.drawer-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
}
|
||||
|
||||
/* TODO: remplacer par la classe globale .section-title de pmocontrol.css */
|
||||
.drawer-section-title {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--color-text-secondary);
|
||||
margin: 0 0 var(--spacing-sm) 0;
|
||||
padding: 0 var(--spacing-sm);
|
||||
}
|
||||
|
||||
/* Liste d'items générique */
|
||||
.drawer-item-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.drawer-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: 12px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
transition: all var(--transition-fast) ease;
|
||||
}
|
||||
|
||||
.drawer-item.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.drawer-item.clickable:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.drawer-item.clickable:active {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.drawer-item.offline {
|
||||
opacity: var(--opacity-disabled, 0.5);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Icône dans un item */
|
||||
.drawer-item-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
flex-shrink: 0;
|
||||
border-radius: 8px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
/* Info texte dans un item */
|
||||
.drawer-item-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.drawer-item-name {
|
||||
font-size: var(--text-base);
|
||||
font-weight: 600;
|
||||
color: var(--color-text);
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drawer-item-sub {
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-secondary);
|
||||
margin: 2px 0 0 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
FOOTER
|
||||
======================================== */
|
||||
|
||||
.drawer-footer {
|
||||
padding: var(--spacing-md);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
.drawer-footer {
|
||||
border-top-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Les animations d'entrée/sortie sont définies dans chaque composant (scoped)
|
||||
car elles diffèrent selon la direction (gauche/droite/bas) */
|
||||
@@ -434,3 +434,122 @@ input[type="range"]::-moz-range-thumb:hover {
|
||||
white-space: nowrap;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
UTILITIES
|
||||
======================================== */
|
||||
|
||||
/* Section title (used in drawers and panels) */
|
||||
.section-title {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
color: var(--color-text-secondary);
|
||||
margin: 0 0 var(--spacing-sm) 0;
|
||||
}
|
||||
|
||||
/* Icon-only circular button */
|
||||
.icon-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
color: var(--color-text);
|
||||
transition: background var(--transition-fast) ease, transform var(--transition-fast) ease;
|
||||
}
|
||||
|
||||
.icon-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.icon-btn:active {
|
||||
transform: scale(0.92);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
.icon-btn {
|
||||
background: rgba(0, 0, 0, 0.06);
|
||||
border-color: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
.icon-btn:hover {
|
||||
background: rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
PROTOCOL BADGES (global, used in BottomTabBar, RendererDrawer, RendererCard)
|
||||
======================================== */
|
||||
|
||||
.protocol-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.2rem 0.5rem;
|
||||
border-radius: var(--radius-full);
|
||||
font-size: var(--text-xs);
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.protocol-upnp {
|
||||
background-color: rgba(59, 130, 246, 0.15);
|
||||
color: #3b82f6;
|
||||
border-color: rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-openhome {
|
||||
background-color: rgba(139, 92, 246, 0.15);
|
||||
color: #8b5cf6;
|
||||
border-color: rgba(139, 92, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-hybrid {
|
||||
background-color: rgba(16, 185, 129, 0.15);
|
||||
color: #10b981;
|
||||
border-color: rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.protocol-chromecast {
|
||||
background-color: rgba(245, 158, 11, 0.15);
|
||||
color: #f59e0b;
|
||||
border-color: rgba(245, 158, 11, 0.3);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
SCROLLBAR (webkit)
|
||||
======================================== */
|
||||
|
||||
.scrollbar-thin::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.scrollbar-thin::-webkit-scrollbar-track {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.scrollbar-thin::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.scrollbar-thin::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
ANIMATIONS
|
||||
======================================== */
|
||||
|
||||
@keyframes pulse-opacity {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
/* Primary color (brand) */
|
||||
--color-primary: #667eea;
|
||||
--color-primary-hover: #5568d3;
|
||||
/* Primary color RGB components (for rgba() usage) */
|
||||
--color-primary-rgb: 102, 126, 234;
|
||||
|
||||
/* ========================================
|
||||
Transitions
|
||||
|
||||
@@ -1412,17 +1412,17 @@ onMounted(() => {
|
||||
|
||||
<style scoped>
|
||||
.playlist-manager {
|
||||
padding: 1rem;
|
||||
padding: var(--spacing-md);
|
||||
width: 100%;
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
box-sizing: border-box;
|
||||
color: #f5f5f5;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.playlist-manager {
|
||||
padding: 0.5rem;
|
||||
padding: var(--spacing-sm);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1430,56 +1430,63 @@ onMounted(() => {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #2b2b2b;
|
||||
background: #151515;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-lg);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
margin-bottom: var(--spacing-md);
|
||||
}
|
||||
|
||||
.header h2 {
|
||||
margin: 0;
|
||||
color: #61dafb;
|
||||
color: var(--color-primary);
|
||||
font-size: var(--text-xl);
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 0.25rem 0 0;
|
||||
color: #b0b0b0;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.header-stats {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.header-stats span {
|
||||
background: #232323;
|
||||
border-radius: 999px;
|
||||
padding: 0.35rem 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
color: #ddd;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
border-radius: var(--radius-full);
|
||||
padding: 0.25rem 0.75rem;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.header-actions button {
|
||||
padding: 0.6rem 1.2rem;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem 1rem;
|
||||
border-radius: var(--radius-md);
|
||||
border: none;
|
||||
background: #61dafb;
|
||||
color: #0b0b0b;
|
||||
background: var(--color-primary);
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
font-size: var(--text-sm);
|
||||
transition: opacity var(--transition-fast);
|
||||
}
|
||||
|
||||
.header-actions button:disabled {
|
||||
opacity: 0.6;
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.panels {
|
||||
display: grid;
|
||||
grid-template-columns: 360px 1fr;
|
||||
gap: 1.5rem;
|
||||
grid-template-columns: 340px 1fr;
|
||||
gap: var(--spacing-md);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
@@ -1490,28 +1497,28 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.section-card {
|
||||
background: #1f1f1f;
|
||||
border: 1px solid #2f2f2f;
|
||||
border-radius: 12px;
|
||||
padding: 1rem;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-md);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 1rem;
|
||||
border: 1px dashed #3a3a3a;
|
||||
border-radius: 8px;
|
||||
padding: var(--spacing-md);
|
||||
border: 1px dashed rgba(255, 255, 255, 0.15);
|
||||
border-radius: var(--radius-md);
|
||||
text-align: center;
|
||||
color: #a8a8a8;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.list-section {
|
||||
@@ -1522,95 +1529,107 @@ onMounted(() => {
|
||||
.playlist-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.playlist-card {
|
||||
border: 1px solid #2a2a2a;
|
||||
border-radius: 10px;
|
||||
padding: 0.85rem;
|
||||
background: #242424;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.4rem;
|
||||
gap: 0.3rem;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
transition: border-color var(--transition-fast), background var(--transition-fast);
|
||||
}
|
||||
|
||||
.playlist-card:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.playlist-card.selected {
|
||||
border-color: #61dafb;
|
||||
box-shadow: 0 0 0 1px rgba(97, 218, 251, 0.4);
|
||||
border-color: var(--color-primary);
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
font-weight: 600;
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.card-metrics,
|
||||
.card-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.85rem;
|
||||
color: #bdbdbd;
|
||||
gap: var(--spacing-sm);
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.card-artist {
|
||||
margin-top: 0.25rem;
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.artist-label {
|
||||
font-size: 0.85rem;
|
||||
color: #90caf9;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-primary);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.detail-card {
|
||||
background: #111;
|
||||
border: 1px solid #2b2b2b;
|
||||
border-radius: 14px;
|
||||
padding: 1.25rem;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--spacing-md);
|
||||
min-height: 400px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: grid;
|
||||
grid-template-columns: 140px 1fr auto;
|
||||
gap: 1rem;
|
||||
grid-template-columns: 100px 1fr auto;
|
||||
gap: var(--spacing-md);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.detail-header-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.detail-header-main h3 {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
align-items: center;
|
||||
font-size: var(--text-lg);
|
||||
}
|
||||
|
||||
.detail-cover {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 10px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: var(--radius-md);
|
||||
overflow: hidden;
|
||||
background: #1a1a1a;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px solid #2f2f2f;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.detail-cover img {
|
||||
@@ -1620,23 +1639,29 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.detail-id {
|
||||
margin: 0.2rem 0 0;
|
||||
color: #9c9c9c;
|
||||
font-size: 0.85rem;
|
||||
margin: 0;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.detail-header-actions button {
|
||||
background: #232323;
|
||||
border: 1px solid #3d3d3d;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem 0.9rem;
|
||||
color: #f5f5f5;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0.4rem 0.8rem;
|
||||
color: var(--color-text);
|
||||
cursor: pointer;
|
||||
font-size: var(--text-sm);
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.detail-header-actions button:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.detail-header {
|
||||
grid-template-columns: 100px 1fr;
|
||||
grid-template-columns: 80px 1fr;
|
||||
}
|
||||
|
||||
.detail-header-actions {
|
||||
@@ -1651,9 +1676,8 @@ onMounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #1b1b1b;
|
||||
color: #666;
|
||||
font-size: 2rem;
|
||||
color: var(--color-text-secondary);
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
.cover-placeholder.small {
|
||||
@@ -1662,18 +1686,18 @@ onMounted(() => {
|
||||
|
||||
.cover-preview-row {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
gap: var(--spacing-sm);
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.cover-preview {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
border-radius: 8px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: var(--radius-md);
|
||||
overflow: hidden;
|
||||
border: 1px solid #2d2d2d;
|
||||
background: #0f0f0f;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -1686,27 +1710,28 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.cover-preview.small {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.btn-compact {
|
||||
padding: 0.25rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
padding: 0.2rem 0.5rem;
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.detail-stats {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 1rem;
|
||||
font-size: 0.95rem;
|
||||
gap: var(--spacing-md);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.cover-stat code {
|
||||
background: #0f0f0f;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
padding: 0.15rem 0.4rem;
|
||||
border-radius: 4px;
|
||||
border-radius: var(--radius-sm);
|
||||
margin-right: 0.4rem;
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.detail-messages .error,
|
||||
@@ -1715,32 +1740,34 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.section-subcard {
|
||||
background: #181818;
|
||||
border: 1px solid #2b2b2b;
|
||||
border-radius: 10px;
|
||||
padding: 1rem;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--spacing-md);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.section-subcard h4 {
|
||||
margin: 0;
|
||||
color: #e7e7e7;
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.field,
|
||||
.checkbox {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.35rem;
|
||||
font-size: 0.9rem;
|
||||
gap: 0.3rem;
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.checkbox {
|
||||
@@ -1751,11 +1778,12 @@ form {
|
||||
.field input,
|
||||
.field select,
|
||||
.field textarea {
|
||||
background: #0f0f0f;
|
||||
border: 1px solid #3f3f3f;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem;
|
||||
color: #f5f5f5;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0.45rem var(--spacing-sm);
|
||||
color: var(--color-text);
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.field textarea {
|
||||
@@ -1764,14 +1792,14 @@ form {
|
||||
|
||||
.field-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||||
gap: 0.75rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.field-group {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.form-messages {
|
||||
@@ -1779,13 +1807,15 @@ form {
|
||||
}
|
||||
|
||||
.primary {
|
||||
background: #4b9ed0;
|
||||
background: var(--color-primary);
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 0.6rem 1rem;
|
||||
border-radius: 6px;
|
||||
padding: 0.5rem var(--spacing-md);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
font-size: var(--text-sm);
|
||||
transition: opacity var(--transition-fast);
|
||||
}
|
||||
|
||||
.primary:disabled {
|
||||
@@ -1794,19 +1824,35 @@ form {
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 0.9rem;
|
||||
font-size: var(--text-sm);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #2c2c2c;
|
||||
border: 1px solid #3d3d3d;
|
||||
color: #f5f5f5;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
color: var(--color-text);
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0.4rem 0.8rem;
|
||||
cursor: pointer;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #c0392b;
|
||||
border: 1px solid #d35400;
|
||||
background: rgba(192, 57, 43, 0.8);
|
||||
border: 1px solid rgba(211, 84, 0, 0.6);
|
||||
color: #fff;
|
||||
border-radius: var(--radius-md);
|
||||
padding: 0.4rem 0.8rem;
|
||||
cursor: pointer;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: rgba(192, 57, 43, 1);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
@@ -1815,68 +1861,75 @@ button:disabled {
|
||||
}
|
||||
|
||||
.pill {
|
||||
background: #2f2f2f;
|
||||
border-radius: 999px;
|
||||
padding: 0.15rem 0.6rem;
|
||||
font-size: 0.75rem;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.15);
|
||||
border-radius: var(--radius-full);
|
||||
padding: 0.1rem 0.55rem;
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 0.85rem;
|
||||
color: #a5a5a5;
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: #8a8a8a;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.tracks .section-header {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.track-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.9rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.track-card {
|
||||
display: grid;
|
||||
grid-template-columns: 120px 1fr auto;
|
||||
gap: 1rem;
|
||||
padding: 0.9rem;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #2a2a2a;
|
||||
background: #16181f;
|
||||
grid-template-columns: 80px 1fr auto;
|
||||
gap: var(--spacing-md);
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
align-items: center;
|
||||
transition: background var(--transition-fast);
|
||||
}
|
||||
|
||||
.track-card:hover {
|
||||
background: rgba(255, 255, 255, 0.07);
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.track-card {
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-columns: 80px 1fr;
|
||||
}
|
||||
|
||||
.cover-wrapper {
|
||||
width: 100%;
|
||||
height: 220px;
|
||||
.track-actions {
|
||||
grid-column: span 2;
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
||||
.track-card.lazy {
|
||||
border-color: #d4a017;
|
||||
box-shadow: 0 0 0 1px rgba(212, 160, 23, 0.4);
|
||||
border-color: rgba(212, 160, 23, 0.5);
|
||||
background: rgba(212, 160, 23, 0.05);
|
||||
}
|
||||
|
||||
.cover-wrapper {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 10px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: var(--radius-md);
|
||||
overflow: hidden;
|
||||
background: #1f1f1f;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.cover-wrapper img {
|
||||
@@ -1886,90 +1939,101 @@ button:disabled {
|
||||
}
|
||||
|
||||
.track-card .cover-placeholder {
|
||||
font-size: 2rem;
|
||||
color: #6f6f6f;
|
||||
font-size: 1.5rem;
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.cover-lazy-pill {
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
bottom: 6px;
|
||||
right: 4px;
|
||||
bottom: 4px;
|
||||
background: #d4a017;
|
||||
color: #1a1a1a;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 999px;
|
||||
font-size: 0.7rem;
|
||||
padding: 0.1rem 0.4rem;
|
||||
border-radius: var(--radius-full);
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.track-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
gap: 0.2rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.track-title {
|
||||
font-size: 1rem;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.track-artist,
|
||||
.track-album {
|
||||
font-size: 0.9rem;
|
||||
color: #bbbbbb;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-secondary);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.track-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
font-size: 0.85rem;
|
||||
color: #a0a0a0;
|
||||
gap: var(--spacing-sm);
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-secondary);
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.pk-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.85rem;
|
||||
word-break: break-word;
|
||||
gap: 0.2rem;
|
||||
font-size: var(--text-xs);
|
||||
word-break: break-all;
|
||||
color: var(--color-text-secondary);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
.pk-line {
|
||||
display: flex;
|
||||
gap: 0.4rem;
|
||||
gap: 0.3rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.pk-line .label {
|
||||
font-size: 0.75rem;
|
||||
color: #888;
|
||||
font-size: 0.7rem;
|
||||
color: var(--color-text-secondary);
|
||||
text-transform: uppercase;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.pk-line code {
|
||||
background: #0f0f0f;
|
||||
padding: 0.2rem 0.4rem;
|
||||
border-radius: 4px;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
padding: 0.1rem 0.35rem;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.added-info {
|
||||
font-size: 0.8rem;
|
||||
color: #909090;
|
||||
font-size: var(--text-xs);
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
||||
.track-actions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
gap: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.error {
|
||||
color: #ff7a7a;
|
||||
color: var(--status-offline);
|
||||
}
|
||||
|
||||
.success {
|
||||
color: #6adf8b;
|
||||
color: var(--status-playing);
|
||||
}
|
||||
</style>
|
||||
.detail-header-main { display: flex; flex-direction: column; gap: 0.25rem; }
|
||||
|
||||
@@ -257,14 +257,7 @@ async function handleQueueItem(itemId: string, rendererId: string) {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
/* @keyframes spin is now global in pmocontrol.css */
|
||||
|
||||
/* Error */
|
||||
.browser-error {
|
||||
|
||||
@@ -253,23 +253,7 @@ function goToRenderer() {
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.protocol-upnp {
|
||||
background-color: rgba(59, 130, 246, 0.1);
|
||||
color: #3b82f6;
|
||||
border: 1px solid #3b82f6;
|
||||
}
|
||||
|
||||
.protocol-openhome {
|
||||
background-color: rgba(139, 92, 246, 0.1);
|
||||
color: #8b5cf6;
|
||||
border: 1px solid #8b5cf6;
|
||||
}
|
||||
|
||||
.protocol-hybrid {
|
||||
background-color: rgba(16, 185, 129, 0.1);
|
||||
color: #10b981;
|
||||
border: 1px solid #10b981;
|
||||
}
|
||||
/* Protocol badge colors (.protocol-upnp, .protocol-openhome, etc.) → pmocontrol.css */
|
||||
|
||||
/* Cover */
|
||||
.card-cover {
|
||||
|
||||
@@ -148,18 +148,18 @@ function handleRendererDrawerClick() {
|
||||
gap: var(--spacing-md);
|
||||
height: 72px;
|
||||
padding: 0 var(--spacing-md);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(30px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(30px) saturate(180%);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
|
||||
background: rgba(22, 22, 32, 0.96);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@media (prefers-color-scheme: light) {
|
||||
.bottom-bar {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: rgba(245, 245, 250, 0.97);
|
||||
border-top-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,40 +293,7 @@ function handleRendererDrawerClick() {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Protocol badge */
|
||||
.protocol-badge {
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.protocol-upnp {
|
||||
background-color: rgba(59, 130, 246, 0.15);
|
||||
color: #3b82f6;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-openhome {
|
||||
background-color: rgba(139, 92, 246, 0.15);
|
||||
color: #8b5cf6;
|
||||
border: 1px solid rgba(139, 92, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-hybrid {
|
||||
background-color: rgba(16, 185, 129, 0.15);
|
||||
color: #10b981;
|
||||
border: 1px solid rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.protocol-chromecast {
|
||||
background-color: rgba(244, 114, 182, 0.15);
|
||||
color: #f472b6;
|
||||
border: 1px solid rgba(244, 114, 182, 0.3);
|
||||
}
|
||||
/* Protocol badge classes (.protocol-badge, .protocol-upnp, etc.) are now global in pmocontrol.css */
|
||||
|
||||
.status-badge {
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -153,14 +153,7 @@ async function handleRefresh() {
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
/* @keyframes spin is now global in pmocontrol.css */
|
||||
|
||||
/* Responsive mobile */
|
||||
@media (max-width: 768px) {
|
||||
|
||||
@@ -138,7 +138,7 @@ function handleRendererClick(renderer: RendererSummary) {
|
||||
}
|
||||
|
||||
function handleSettingsClick() {
|
||||
router.push("/debug/api-dashboard");
|
||||
router.push("/debug");
|
||||
close();
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ async function handleTransferQueue(event: Event, targetRendererId: string) {
|
||||
|
||||
<!-- Drawer -->
|
||||
<Transition name="drawer">
|
||||
<aside v-if="modelValue" class="renderer-drawer">
|
||||
<aside v-if="modelValue" class="app-drawer renderer-drawer">
|
||||
<!-- Header -->
|
||||
<header class="drawer-header">
|
||||
<div class="drawer-title-section">
|
||||
@@ -453,90 +453,21 @@ async function handleTransferQueue(event: Event, targetRendererId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Positionnement spécifique — le reste est dans drawers.css (.app-drawer) */
|
||||
.renderer-drawer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 50vw; /* Desktop/landscape: 50% de l'écran */
|
||||
background: rgba(255, 255, 255, 0.08); /* Plus transparent */
|
||||
backdrop-filter: blur(40px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(40px) saturate(180%);
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: -4px 0 32px rgba(0, 0, 0, 0.25);
|
||||
z-index: 201;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow: -4px 0 32px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@media (prefers-color-scheme: light) {
|
||||
.renderer-drawer {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
border-left-color: rgba(255, 255, 255, 0.1);
|
||||
border-left-color: rgba(0, 0, 0, 0.1);
|
||||
box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.drawer-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-lg);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.drawer-title-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
color: var(--color-text);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.drawer-title {
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drawer-close-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.drawer-close-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.drawer-close-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* Content */
|
||||
.drawer-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: var(--spacing-md);
|
||||
}
|
||||
/* .drawer-header, .drawer-title, .drawer-close-btn, .drawer-content définis dans drawers.css */
|
||||
|
||||
.renderer-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -663,40 +594,7 @@ async function handleTransferQueue(event: Event, targetRendererId: string) {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Protocol badge */
|
||||
.protocol-badge {
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.protocol-upnp {
|
||||
background-color: rgba(59, 130, 246, 0.15);
|
||||
color: #3b82f6;
|
||||
border: 1px solid rgba(59, 130, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-openhome {
|
||||
background-color: rgba(139, 92, 246, 0.15);
|
||||
color: #8b5cf6;
|
||||
border: 1px solid rgba(139, 92, 246, 0.3);
|
||||
}
|
||||
|
||||
.protocol-hybrid {
|
||||
background-color: rgba(16, 185, 129, 0.15);
|
||||
color: #10b981;
|
||||
border: 1px solid rgba(16, 185, 129, 0.3);
|
||||
}
|
||||
|
||||
.protocol-chromecast {
|
||||
background-color: rgba(244, 114, 182, 0.15);
|
||||
color: #f472b6;
|
||||
border: 1px solid rgba(244, 114, 182, 0.3);
|
||||
}
|
||||
/* Protocol badge classes (.protocol-badge, .protocol-upnp, etc.) are now global in pmocontrol.css */
|
||||
|
||||
/* Transport button */
|
||||
.transport-btn {
|
||||
@@ -764,7 +662,7 @@ async function handleTransferQueue(event: Event, targetRendererId: string) {
|
||||
right: 0;
|
||||
top: calc(100% + 4px);
|
||||
min-width: 200px;
|
||||
background: var(--color-surface-elevated);
|
||||
background: rgba(20, 20, 30, 0.98);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
|
||||
@@ -228,11 +228,11 @@ async function handleQueueItemClick(item: QueueItem) {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(30px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(30px) saturate(180%);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
|
||||
background: rgba(22, 22, 32, 0.96);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
|
||||
/* Fermé: caché sauf le toggle (56px) qui dépasse au-dessus de la BottomTabBar (64px) */
|
||||
transform: translateY(calc(100% - 56px - 64px));
|
||||
transition: transform 0.3s ease;
|
||||
@@ -250,6 +250,13 @@ async function handleQueueItemClick(item: QueueItem) {
|
||||
pointer-events: auto; /* Ouvert: capture les clics */
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
.queue-drawer {
|
||||
background: rgba(245, 245, 250, 0.97);
|
||||
border-top-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.queue-drawer-toggle {
|
||||
width: 100%;
|
||||
height: 56px;
|
||||
|
||||
@@ -353,7 +353,7 @@ async function handleAddAfterCurrent(event: Event, item: ContainerEntry) {
|
||||
}
|
||||
|
||||
function handleSettingsClick() {
|
||||
router.push("/debug/api-dashboard");
|
||||
router.push("/debug");
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
@@ -367,7 +367,7 @@ function handleSettingsClick() {
|
||||
|
||||
<!-- Drawer -->
|
||||
<Transition name="drawer">
|
||||
<aside v-if="modelValue" class="server-drawer">
|
||||
<aside v-if="modelValue" class="app-drawer server-drawer">
|
||||
<!-- Header - Liste des serveurs -->
|
||||
<header v-if="!isNavigating" class="drawer-header">
|
||||
<div class="drawer-title-section">
|
||||
@@ -386,7 +386,7 @@ function handleSettingsClick() {
|
||||
<!-- Header - Navigation dans un serveur -->
|
||||
<header v-else class="drawer-header">
|
||||
<button
|
||||
class="back-btn"
|
||||
class="drawer-back-btn"
|
||||
@click="goBack"
|
||||
aria-label="Retour aux serveurs"
|
||||
>
|
||||
@@ -720,109 +720,20 @@ function handleSettingsClick() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Positionnement spécifique — le reste est dans drawers.css (.app-drawer) */
|
||||
.server-drawer {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 50vw; /* Desktop/landscape: 50% de l'écran */
|
||||
background: rgba(255, 255, 255, 0.08); /* Plus transparent */
|
||||
backdrop-filter: blur(40px) saturate(180%);
|
||||
-webkit-backdrop-filter: blur(40px) saturate(180%);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.15);
|
||||
box-shadow: 4px 0 32px rgba(0, 0, 0, 0.25);
|
||||
z-index: 201;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.12);
|
||||
box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@media (prefers-color-scheme: light) {
|
||||
.server-drawer {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
border-right-color: rgba(255, 255, 255, 0.1);
|
||||
border-right-color: rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 4px 0 32px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.drawer-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-lg);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.drawer-title-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
color: var(--color-text);
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.drawer-title {
|
||||
font-size: var(--text-xl);
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.drawer-title.small {
|
||||
font-size: var(--text-base);
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.drawer-close-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.drawer-close-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.drawer-close-btn:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* Breadcrumb */
|
||||
.breadcrumb {
|
||||
display: flex;
|
||||
@@ -864,12 +775,7 @@ function handleSettingsClick() {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Content */
|
||||
.drawer-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: var(--spacing-md);
|
||||
}
|
||||
/* .drawer-content défini dans drawers.css */
|
||||
|
||||
.server-section {
|
||||
margin-bottom: var(--spacing-lg);
|
||||
@@ -1243,11 +1149,7 @@ function handleSettingsClick() {
|
||||
animation: spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
/* @keyframes spin is now global in pmocontrol.css */
|
||||
|
||||
.loading-state p {
|
||||
margin: 0;
|
||||
|
||||
@@ -215,9 +215,6 @@ watch(editingVar, (newVar) => {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* Error state */
|
||||
.error-state {
|
||||
|
||||
@@ -14,6 +14,7 @@ import "./style.css";
|
||||
import "./assets/styles/variables.css";
|
||||
import "./assets/styles/pmocontrol.css";
|
||||
import "./assets/styles/glass-theme.css";
|
||||
import "./assets/styles/drawers.css";
|
||||
|
||||
// Créer l'application Vue
|
||||
const app = createApp(App);
|
||||
|
||||
@@ -17,6 +17,7 @@ import PlayListManager from "../components/PlayListManager.vue";
|
||||
import UpnpExplorer from "../components/UpnpExplorer.vue";
|
||||
import APIDashboard from "../components/APIDashboard.vue";
|
||||
import RadioParadiseExplorer from "../components/RadioParadiseExplorer.vue";
|
||||
import DebugView from "../views/DebugView.vue";
|
||||
|
||||
const routes = [
|
||||
// PMOControl Unified Interface (nouvelle interface unifiée avec onglets)
|
||||
@@ -43,6 +44,13 @@ const routes = [
|
||||
component: MediaServerView,
|
||||
},
|
||||
|
||||
// Debug hub
|
||||
{
|
||||
path: "/debug",
|
||||
name: "Debug",
|
||||
component: DebugView,
|
||||
},
|
||||
|
||||
// Debug menu (anciennes routes déplacées sous /debug)
|
||||
{
|
||||
path: "/debug/generic-player",
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
|
||||
/* Taille de base légèrement réduite — remplace le zoom: 0.85 global */
|
||||
font-size: 15px;
|
||||
|
||||
color-scheme: light dark;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
background-color: #242424;
|
||||
@@ -68,8 +71,6 @@ button:focus-visible {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
zoom: 0.85;
|
||||
transform-origin: top left;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
|
||||
197
pmoapp/webapp/src/views/DebugView.vue
Normal file
197
pmoapp/webapp/src/views/DebugView.vue
Normal file
@@ -0,0 +1,197 @@
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from "vue-router";
|
||||
import {
|
||||
Music,
|
||||
ScrollText,
|
||||
Image,
|
||||
Database,
|
||||
ListMusic,
|
||||
Network,
|
||||
LayoutDashboard,
|
||||
Radio,
|
||||
ArrowLeft,
|
||||
} from "lucide-vue-next";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const tools = [
|
||||
{
|
||||
path: "/debug/covers-cache",
|
||||
name: "Cache des couvertures",
|
||||
description: "Visualiser et gérer le cache d'images de couverture",
|
||||
icon: Image,
|
||||
},
|
||||
{
|
||||
path: "/debug/audio-cache",
|
||||
name: "Cache audio",
|
||||
description: "Gérer le cache des fichiers audio",
|
||||
icon: Database,
|
||||
},
|
||||
{
|
||||
path: "/debug/playlists",
|
||||
name: "Playlists",
|
||||
description: "Gérer et inspecter les playlists en cache",
|
||||
icon: ListMusic,
|
||||
},
|
||||
{
|
||||
path: "/debug/logs",
|
||||
name: "Logs",
|
||||
description: "Consulter les logs du serveur en temps réel",
|
||||
icon: ScrollText,
|
||||
},
|
||||
{
|
||||
path: "/debug/upnp",
|
||||
name: "Explorateur UPnP",
|
||||
description: "Parcourir les dispositifs et services UPnP",
|
||||
icon: Network,
|
||||
},
|
||||
{
|
||||
path: "/debug/api-dashboard",
|
||||
name: "API Dashboard",
|
||||
description: "Documentation et test des API disponibles",
|
||||
icon: LayoutDashboard,
|
||||
},
|
||||
{
|
||||
path: "/debug/generic-player",
|
||||
name: "Lecteur générique",
|
||||
description: "Lecteur de test pour les flux audio",
|
||||
icon: Music,
|
||||
},
|
||||
{
|
||||
path: "/debug/radio-paradise",
|
||||
name: "Radio Paradise",
|
||||
description: "Explorateur Radio Paradise",
|
||||
icon: Radio,
|
||||
},
|
||||
];
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="debug-view">
|
||||
<header class="debug-header">
|
||||
<button class="back-btn" @click="router.push('/')" title="Retour">
|
||||
<ArrowLeft :size="20" />
|
||||
</button>
|
||||
<h1 class="debug-title">Outils de debug</h1>
|
||||
</header>
|
||||
|
||||
<div class="debug-grid">
|
||||
<button
|
||||
v-for="tool in tools"
|
||||
:key="tool.path"
|
||||
class="tool-card"
|
||||
@click="router.push(tool.path)"
|
||||
>
|
||||
<div class="tool-icon">
|
||||
<component :is="tool.icon" :size="28" />
|
||||
</div>
|
||||
<div class="tool-info">
|
||||
<div class="tool-name">{{ tool.name }}</div>
|
||||
<div class="tool-desc">{{ tool.description }}</div>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.debug-view {
|
||||
min-height: 100vh;
|
||||
padding: var(--spacing-lg);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.debug-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
padding: 0;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
color: var(--color-text);
|
||||
transition: background var(--transition-fast) ease;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.debug-title {
|
||||
font-size: var(--text-2xl);
|
||||
font-weight: 700;
|
||||
margin: 0;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.debug-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
.tool-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
padding: var(--spacing-lg);
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
border-radius: var(--radius-lg);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
color: var(--color-text);
|
||||
transition: all var(--transition-fast) ease;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.tool-card:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.tool-card:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.tool-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(102, 126, 234, 0.15);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.tool-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.tool-name {
|
||||
font-size: var(--text-base);
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.tool-desc {
|
||||
font-size: var(--text-sm);
|
||||
color: var(--color-text-secondary);
|
||||
line-height: 1.4;
|
||||
}
|
||||
</style>
|
||||
@@ -499,7 +499,13 @@ fn playlist_track_to_response(
|
||||
if let Ok(mut entry) = cache.db.get(&track.cache_pk, true) {
|
||||
if let Some(lazy_pk) = entry.lazy_pk.take() {
|
||||
if lazy_pk != response.cache_pk {
|
||||
response.lazy_pk = Some(lazy_pk);
|
||||
response.lazy_pk = Some(lazy_pk.clone());
|
||||
}
|
||||
// Si l'entrée lazy n'a pas de metadata, essayer l'entrée réelle
|
||||
if entry.metadata.is_none() {
|
||||
if let Ok(real_entry) = cache.db.get(&lazy_pk, true) {
|
||||
entry.metadata = real_entry.metadata;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,113 +54,9 @@ pub const DEFAULT_REQUEST_TIMEOUT_SECS: u64 = 30;
|
||||
/// Default User-Agent
|
||||
pub const DEFAULT_USER_AGENT: &str = "PMOMusic/0.3.10 (pmoradiofrance)";
|
||||
|
||||
/// Known main stations (fallback if scraping fails)
|
||||
pub const KNOWN_MAIN_STATIONS: &[(&str, &str)] = &[
|
||||
("franceinter", "France Inter"),
|
||||
("franceinfo", "France Info"),
|
||||
("franceculture", "France Culture"),
|
||||
("francemusique", "France Musique"),
|
||||
("fip", "FIP"),
|
||||
("mouv", "Mouv'"),
|
||||
("francebleu", "France Bleu"),
|
||||
];
|
||||
|
||||
/// Mapping slug → numeric station ID for the livemeta/pull API
|
||||
/// IDs extracted from www.radiofrance.fr SvelteKit page data (2026)
|
||||
pub const STATION_IDS: &[(&str, u32)] = &[
|
||||
("franceinter", 1),
|
||||
("franceinfo", 2),
|
||||
("francemusique", 4),
|
||||
("franceculture", 5),
|
||||
("mouv", 6),
|
||||
("fip", 7),
|
||||
("francebleu", 56),
|
||||
// FIP webradios
|
||||
("fip_rock", 64),
|
||||
("fip_jazz", 65),
|
||||
("fip_groove", 66),
|
||||
("fip_reggae", 71),
|
||||
("fip_electro", 74),
|
||||
("fip_metal", 77),
|
||||
("fip_pop", 78),
|
||||
("fip_world", 69),
|
||||
("fip_nouveautes", 70),
|
||||
("fip_hiphop", 95),
|
||||
("fip_sacre_francais", 96),
|
||||
("fip_cultes", 709),
|
||||
];
|
||||
|
||||
/// Icecast HiFi AAC stream URLs (stable, not from API)
|
||||
/// Format: https://icecast.radiofrance.fr/{name}-hifi.aac
|
||||
pub const STATION_STREAMS: &[(&str, &str)] = &[
|
||||
(
|
||||
"franceinter",
|
||||
"https://icecast.radiofrance.fr/franceinter-hifi.aac",
|
||||
),
|
||||
(
|
||||
"franceinfo",
|
||||
"https://icecast.radiofrance.fr/franceinfo-hifi.aac",
|
||||
),
|
||||
(
|
||||
"franceculture",
|
||||
"https://icecast.radiofrance.fr/franceculture-hifi.aac",
|
||||
),
|
||||
(
|
||||
"francemusique",
|
||||
"https://icecast.radiofrance.fr/francemusique-hifi.aac",
|
||||
),
|
||||
("fip", "https://icecast.radiofrance.fr/fip-hifi.aac"),
|
||||
("mouv", "https://icecast.radiofrance.fr/mouv-hifi.aac"),
|
||||
// FIP webradios
|
||||
(
|
||||
"fip_rock",
|
||||
"https://icecast.radiofrance.fr/fiprock-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_jazz",
|
||||
"https://icecast.radiofrance.fr/fipjazz-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_groove",
|
||||
"https://icecast.radiofrance.fr/fipgroove-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_reggae",
|
||||
"https://icecast.radiofrance.fr/fipreggae-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_electro",
|
||||
"https://icecast.radiofrance.fr/fipelectro-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_metal",
|
||||
"https://icecast.radiofrance.fr/fipmetal-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_pop",
|
||||
"https://icecast.radiofrance.fr/fippop-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_world",
|
||||
"https://icecast.radiofrance.fr/fipworld-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_nouveautes",
|
||||
"https://icecast.radiofrance.fr/fipnouveautes-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_hiphop",
|
||||
"https://icecast.radiofrance.fr/fiphiphop-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_sacre_francais",
|
||||
"https://icecast.radiofrance.fr/fipsacrefrancais-hifi.aac",
|
||||
),
|
||||
(
|
||||
"fip_cultes",
|
||||
"https://icecast.radiofrance.fr/fipcultes-hifi.aac",
|
||||
),
|
||||
];
|
||||
// Données des stations — générées par tools/generate_radiofrance_stations.py
|
||||
// Pour mettre à jour : python3 tools/generate_radiofrance_stations.py > pmoradiofrance/src/stations_data.rs
|
||||
include!("stations_data.rs");
|
||||
|
||||
/// Radio France HTTP client
|
||||
///
|
||||
@@ -454,70 +350,20 @@ impl RadioFranceClient {
|
||||
.collect())
|
||||
}
|
||||
|
||||
/// Discover local France Bleu radios via SvelteKit page data
|
||||
/// Discover local France Bleu radios
|
||||
///
|
||||
/// Scrapes francebleu page for local station slugs and discovers their IDs.
|
||||
/// Met à jour le station_mapping avec les IDs trouvés.
|
||||
/// Returns the list of France Bleu local radios from the static STATION_IDS mapping.
|
||||
///
|
||||
/// The IDs in STATION_IDS were discovered via the livemeta/pull API in March 2026 and
|
||||
/// are stable (the API has been consistent since 2019). France Bleu's local radio
|
||||
/// network is essentially fixed, so a static list is sufficient and robust.
|
||||
pub async fn discover_local_radios(&self) -> Result<Vec<Station>> {
|
||||
let url = format!("{}/francebleu/__data.json", self.base_url);
|
||||
let resp = self
|
||||
.client
|
||||
.get(&url)
|
||||
.timeout(self.timeout)
|
||||
.send()
|
||||
.await?
|
||||
.text()
|
||||
.await?;
|
||||
|
||||
// Extraire les slugs "francebleu_xxx" et les paires (slug, id) de la page
|
||||
let re_slug_id = Regex::new(r#""(francebleu_[a-z_]+)","(\d+)""#)?;
|
||||
let mut stations = Vec::new();
|
||||
let mut found_any = false;
|
||||
|
||||
for cap in re_slug_id.captures_iter(&resp) {
|
||||
let slug = cap[1].to_string();
|
||||
if let Ok(id) = cap[2].parse::<u32>() {
|
||||
let stream_url = Self::derive_stream_url(&slug);
|
||||
self.update_station_entry(&slug, id, stream_url);
|
||||
let name = Self::slug_to_display_name(&slug);
|
||||
stations.push(Station::new(slug, name));
|
||||
found_any = true;
|
||||
}
|
||||
}
|
||||
|
||||
if found_any {
|
||||
return Ok(stations);
|
||||
}
|
||||
|
||||
// Fallback : scraper la page HTML pour les noms "ICI ..."
|
||||
let html_url = format!("{}/francebleu", self.base_url);
|
||||
let html = self
|
||||
.client
|
||||
.get(&html_url)
|
||||
.timeout(self.timeout)
|
||||
.send()
|
||||
.await?
|
||||
.text()
|
||||
.await?;
|
||||
|
||||
let re_ici = Regex::new(r#"ICI ([A-Za-z\u00C0-\u017E][A-Za-z\u00C0-\u017E\s-]+)"#)?;
|
||||
let re_slug = Regex::new(r#""(francebleu_[a-z_]+)""#)?;
|
||||
|
||||
let mut slugs: HashSet<String> = HashSet::new();
|
||||
for cap in re_slug.captures_iter(&html) {
|
||||
slugs.insert(cap[1].to_string());
|
||||
}
|
||||
|
||||
let _names: Vec<String> = re_ici
|
||||
.captures_iter(&html)
|
||||
.map(|c| c[1].trim().to_string())
|
||||
.collect();
|
||||
|
||||
Ok(slugs
|
||||
.into_iter()
|
||||
.map(|slug| {
|
||||
let name = Self::slug_to_display_name(&slug);
|
||||
Station::new(slug, name)
|
||||
Ok(STATION_IDS
|
||||
.iter()
|
||||
.filter(|(slug, _)| slug.starts_with("francebleu_"))
|
||||
.map(|(slug, _)| {
|
||||
let name = Self::slug_to_display_name(slug);
|
||||
Station::new(slug.to_string(), name)
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
@@ -716,14 +562,23 @@ impl RadioFranceClient {
|
||||
vec![]
|
||||
};
|
||||
|
||||
// Visual : la nouvelle API donne directement l'UUID (pas une URL complète)
|
||||
let visual_background = step.visual.as_deref().map(|uuid| EmbedImage {
|
||||
model: "EmbedImage".to_string(),
|
||||
src: ImageSize::Large.build_url(uuid),
|
||||
width: None,
|
||||
height: None,
|
||||
dominant: None,
|
||||
copyright: None,
|
||||
// Visual : l'API peut retourner soit un UUID Pikapi, soit une URL S3/CDN complète
|
||||
let visual_background = step.visual.as_deref().map(|visual| {
|
||||
let src = if visual.starts_with("http") {
|
||||
// URL directe (S3, CDN) — utiliser telle quelle
|
||||
visual.to_string()
|
||||
} else {
|
||||
// UUID Pikapi — construire l'URL
|
||||
ImageSize::Large.build_url(visual)
|
||||
};
|
||||
EmbedImage {
|
||||
model: "EmbedImage".to_string(),
|
||||
src,
|
||||
width: None,
|
||||
height: None,
|
||||
dominant: None,
|
||||
copyright: None,
|
||||
}
|
||||
});
|
||||
|
||||
if step.is_song() {
|
||||
|
||||
@@ -210,12 +210,24 @@ impl CachedMetadata {
|
||||
cache: &Arc<CoverCache>,
|
||||
server_base_url: &str,
|
||||
) -> (Option<String>, Option<String>) {
|
||||
// Extraire l'UUID de la cover (priorité : visual_background > visuals.card > visuals.player)
|
||||
let uuid = metadata
|
||||
// Extraire l'URL de la cover — deux stratégies selon la source :
|
||||
// 1. visual_background.src peut être une URL S3 directe ou une URL Pikapi
|
||||
// 2. visuals.card/player contiennent des URLs Pikapi avec UUID extractable
|
||||
let cover_url = metadata
|
||||
.now
|
||||
.visual_background
|
||||
.as_ref()
|
||||
.and_then(|v| v.extract_uuid())
|
||||
.map(|v| {
|
||||
// Si c'est déjà une URL directe (S3, CDN), l'utiliser telle quelle
|
||||
// Sinon essayer d'extraire l'UUID Pikapi pour construire une URL haute-résolution
|
||||
if v.src.starts_with("http") && !v.src.contains("/pikapi/") {
|
||||
v.src.clone()
|
||||
} else if let Some(uuid) = v.extract_uuid() {
|
||||
ImageSize::Large.build_url(&uuid)
|
||||
} else {
|
||||
v.src.clone()
|
||||
}
|
||||
})
|
||||
.or_else(|| {
|
||||
metadata.now.visuals.as_ref().and_then(|visuals| {
|
||||
visuals
|
||||
@@ -223,13 +235,13 @@ impl CachedMetadata {
|
||||
.as_ref()
|
||||
.and_then(|c| c.extract_uuid())
|
||||
.or_else(|| visuals.player.as_ref().and_then(|p| p.extract_uuid()))
|
||||
.map(|uuid| ImageSize::Large.build_url(&uuid))
|
||||
})
|
||||
});
|
||||
|
||||
let uuid = match uuid {
|
||||
let cover_url = match cover_url {
|
||||
Some(u) => u,
|
||||
None => {
|
||||
// Fallback sur le logo par défaut via l'API REST
|
||||
let logo_url = format!(
|
||||
"{}/api/radiofrance/default-logo",
|
||||
server_base_url.trim_end_matches('/')
|
||||
@@ -238,9 +250,6 @@ impl CachedMetadata {
|
||||
}
|
||||
};
|
||||
|
||||
// URL haute résolution
|
||||
let cover_url = ImageSize::Large.build_url(&uuid);
|
||||
|
||||
// Tenter de cacher la cover
|
||||
match cache.add_from_url(&cover_url, Some("radiofrance")).await {
|
||||
Ok(pk) => {
|
||||
@@ -252,8 +261,8 @@ impl CachedMetadata {
|
||||
|
||||
#[cfg(feature = "logging")]
|
||||
tracing::debug!(
|
||||
"Cached cover - UUID: {}, PK: {}, public_url: {}",
|
||||
uuid,
|
||||
"Cached cover - url: {}, PK: {}, public_url: {}",
|
||||
cover_url,
|
||||
pk,
|
||||
public_url
|
||||
);
|
||||
@@ -262,7 +271,7 @@ impl CachedMetadata {
|
||||
}
|
||||
Err(e) => {
|
||||
#[cfg(feature = "logging")]
|
||||
tracing::warn!("Failed to cache Radio France cover UUID {}: {}", uuid, e);
|
||||
tracing::warn!("Failed to cache Radio France cover {}: {}", cover_url, e);
|
||||
// Fallback sur le logo par défaut en cas d'erreur
|
||||
let logo_url = format!(
|
||||
"{}/api/radiofrance/default-logo",
|
||||
@@ -623,14 +632,21 @@ impl MetadataCache {
|
||||
)
|
||||
.await?;
|
||||
|
||||
// 4. Met à jour le cache
|
||||
{
|
||||
// 4. Met à jour le cache — notifier seulement si le titre a changé (vrai changement de piste)
|
||||
let should_notify = {
|
||||
let mut cache = self.cache.write().await;
|
||||
let changed = cache
|
||||
.get(slug)
|
||||
.map(|old| old.title != metadata.title)
|
||||
.unwrap_or(false); // premier fetch → pas de notification
|
||||
cache.insert(slug.to_string(), metadata.clone());
|
||||
}
|
||||
changed
|
||||
};
|
||||
|
||||
// 5. Notifie les abonnés (async)
|
||||
self.notify_async(slug).await;
|
||||
// 5. Notifie les abonnés uniquement si la piste a changé
|
||||
if should_notify {
|
||||
self.notify_async(slug).await;
|
||||
}
|
||||
|
||||
// 6. Retourne les métadonnées
|
||||
Ok(metadata)
|
||||
|
||||
@@ -332,16 +332,63 @@ impl Station {
|
||||
pub async fn to_didl(
|
||||
&self,
|
||||
metadata_cache: &MetadataCache,
|
||||
_server_base_url: &str,
|
||||
server_base_url: &str,
|
||||
) -> Result<Container> {
|
||||
// Récupérer les métadonnées du cache
|
||||
let cached_metadata = metadata_cache.get(&self.slug).await?;
|
||||
|
||||
// Construire le container de playlist avec l'item via CachedMetadata::to_didl()
|
||||
let playlist_id = format!("radiofrance:{}", self.slug);
|
||||
let parent_id = self.compute_parent_id();
|
||||
|
||||
Ok(cached_metadata.to_didl(&playlist_id, &parent_id))
|
||||
// Graceful degradation : si l'API échoue, construire un item minimal avec juste l'URL de stream
|
||||
match metadata_cache.get(&self.slug).await {
|
||||
Ok(cached_metadata) => Ok(cached_metadata.to_didl(&playlist_id, &parent_id)),
|
||||
Err(_) => {
|
||||
use pmodidl::{Item, Resource};
|
||||
let stream_url = format!(
|
||||
"{}/api/radiofrance/{}/stream",
|
||||
server_base_url.trim_end_matches('/'),
|
||||
self.slug
|
||||
);
|
||||
let item = Item {
|
||||
id: format!("{}:stream", playlist_id),
|
||||
parent_id: playlist_id.clone(),
|
||||
restricted: Some("1".to_string()),
|
||||
title: self.name.clone(),
|
||||
creator: None,
|
||||
class: "object.item.audioItem.audioBroadcast".to_string(),
|
||||
artist: Some("Radio France".to_string()),
|
||||
album: None,
|
||||
genre: None,
|
||||
album_art: Some(format!(
|
||||
"{}/api/radiofrance/default-logo",
|
||||
server_base_url.trim_end_matches('/')
|
||||
)),
|
||||
album_art_pk: None,
|
||||
date: None,
|
||||
original_track_number: None,
|
||||
resources: vec![Resource {
|
||||
protocol_info: "http-get:*:audio/aac:*".to_string(),
|
||||
bits_per_sample: None,
|
||||
sample_frequency: None,
|
||||
nr_audio_channels: None,
|
||||
duration: None,
|
||||
url: stream_url,
|
||||
}],
|
||||
descriptions: vec![],
|
||||
};
|
||||
Ok(Container {
|
||||
id: playlist_id,
|
||||
parent_id,
|
||||
restricted: Some("1".to_string()),
|
||||
child_count: Some("1".to_string()),
|
||||
searchable: Some("0".to_string()),
|
||||
title: self.name.clone(),
|
||||
class: "object.container.playlistContainer".to_string(),
|
||||
artist: Some("Radio France".to_string()),
|
||||
album_art: None,
|
||||
containers: vec![],
|
||||
items: vec![item],
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Calcule le parent_id selon la position de la station
|
||||
|
||||
@@ -275,10 +275,10 @@ impl MusicSource for RadioFranceSource {
|
||||
.await
|
||||
.map_err(|e| MusicSourceError::BrowseError(e.to_string()))?;
|
||||
|
||||
// Si c'est une playlist (1 station), retourner le container lui-même
|
||||
// Sinon retourner ses sous-containers
|
||||
// Si c'est une playlist (1 station), retourner ses items directement
|
||||
// Sinon retourner ses sous-containers (stations du groupe)
|
||||
if container.class == "object.container.playlistContainer" {
|
||||
Ok(BrowseResult::Containers(vec![container]))
|
||||
Ok(BrowseResult::Items(container.items))
|
||||
} else {
|
||||
Ok(BrowseResult::Containers(container.containers))
|
||||
}
|
||||
|
||||
181
pmoradiofrance/src/stations_data.rs
Normal file
181
pmoradiofrance/src/stations_data.rs
Normal file
@@ -0,0 +1,181 @@
|
||||
// ============================================================
|
||||
// FICHIER GÉNÉRÉ AUTOMATIQUEMENT — NE PAS MODIFIER À LA MAIN
|
||||
//
|
||||
// Généré par : tools/generate_radiofrance_stations.py
|
||||
// Date : 2026-03-25
|
||||
// Source : API GraphQL Radio France (openapi.radiofrance.fr)
|
||||
// Token : token de secours (AlexandrePradeilles/ECI, 2022)
|
||||
// Stations : 73
|
||||
//
|
||||
// Pour mettre à jour :
|
||||
// python3 tools/generate_radiofrance_stations.py
|
||||
// ============================================================
|
||||
|
||||
pub const KNOWN_MAIN_STATIONS: &[(&str, &str)] = &[
|
||||
("franceinter", "France Inter"),
|
||||
("franceinfo", "franceinfo"),
|
||||
("francemusique", "France Musique"),
|
||||
("franceculture", "France Culture"),
|
||||
("mouv", "Mouv\'"),
|
||||
("fip", "FIP"),
|
||||
];
|
||||
|
||||
/// Mapping slug → ID numérique livemeta/pull API
|
||||
pub const STATION_IDS: &[(&str, u32)] = &[
|
||||
// Stations principales
|
||||
("franceinter", 1),
|
||||
("franceinfo", 2),
|
||||
("francemusique", 4),
|
||||
("franceculture", 5),
|
||||
("mouv", 6),
|
||||
("fip", 7),
|
||||
// Webradios
|
||||
("franceinter_la_musique_inter", 1101), // La musique d\'Inter
|
||||
("francemusique_classique_easy", 401), // Classique Easy
|
||||
("francemusique_classique_plus", 402), // Classique Plus
|
||||
("francemusique_concert_rf", 403), // Concerts Radio France
|
||||
("francemusique_ocora_monde", 404), // Ocora Musiques du Monde
|
||||
("francemusique_la_jazz", 405), // La Jazz
|
||||
("francemusique_la_contemporaine", 406), // La Contemporaine
|
||||
("francemusique_la_bo", 407), // Musique de Films
|
||||
("francemusique_la_baroque", 408), // La Baroque
|
||||
("francemusique_opera", 409), // Opéra
|
||||
("francemusique_piano_zen", 410), // Piano Zen
|
||||
("fip_rock", 64), // FIP Rock
|
||||
("fip_jazz", 65), // FIP Jazz
|
||||
("fip_groove", 66), // FIP Groove
|
||||
("fip_world", 69), // FIP Monde
|
||||
("fip_nouveautes", 70), // FIP Nouveautés
|
||||
("fip_reggae", 71), // FIP Reggae
|
||||
("fip_electro", 74), // FIP Electro
|
||||
("fip_metal", 77), // FIP Metal
|
||||
("fip_pop", 78), // FIP Pop
|
||||
("fip_hiphop", 95), // FIP Hip-Hop
|
||||
("francebleu_chanson_francaise", 5601), // 100% chanson française
|
||||
// Radios ICI (France Bleu locales)
|
||||
("francebleu_rcfm", 11), // ICI RCFM
|
||||
("francebleu_alsace", 12), // ICI Alsace
|
||||
("francebleu_armorique", 13), // ICI Armorique
|
||||
("francebleu_auxerre", 14), // ICI Auxerre
|
||||
("francebleu_bearn", 15), // ICI Béarn Bigorre
|
||||
("francebleu_belfort_montbeliard", 16), // ICI Belfort-Montbéliard
|
||||
("francebleu_berry", 17), // ICI Berry
|
||||
("francebleu_besancon", 18), // ICI Besançon
|
||||
("francebleu_bourgogne", 19), // ICI Bourgogne
|
||||
("francebleu_breizh_izel", 20), // ICI Breizh Izel
|
||||
("francebleu_champagne_ardenne", 21), // ICI Champagne-Ardenne
|
||||
("francebleu_cotentin", 22), // ICI Cotentin
|
||||
("francebleu_creuse", 23), // ICI Creuse
|
||||
("francebleu_drome_ardeche", 24), // ICI Drôme Ardèche
|
||||
("francebleu_gard_lozere", 25), // ICI Gard Lozère
|
||||
("francebleu_gascogne", 26), // ICI Gascogne
|
||||
("francebleu_gironde", 27), // ICI Gironde
|
||||
("francebleu_herault", 28), // ICI Hérault
|
||||
("francebleu_isere", 29), // ICI Isère
|
||||
("francebleu_la_rochelle", 30), // ICI La Rochelle
|
||||
("francebleu_limousin", 31), // ICI Limousin
|
||||
("francebleu_loire_ocean", 32), // ICI Loire Océan
|
||||
("francebleu_lorraine", 33), // ICI Lorraine (Meurthe-et-Moselle et Vosges)
|
||||
("francebleu_mayenne", 34), // ICI Mayenne
|
||||
("francebleu_nord", 36), // ICI Nord
|
||||
("francebleu_normandie", 37), // ICI Normandie (Calvados - Orne)
|
||||
("francebleu_normandie_seine_maritime", 38), // ICI Normandie (Seine-Maritime - Eure)
|
||||
("francebleu_orleans", 39), // ICI Orléans
|
||||
("francebleu_pays_d_auvergne", 40), // ICI Pays d\'Auvergne
|
||||
("francebleu_pays_basque", 41), // ICI Pays Basque
|
||||
("francebleu_pays_de_savoie", 42), // ICI Pays de Savoie
|
||||
("francebleu_perigord", 43), // ICI Périgord
|
||||
("francebleu_picardie", 44), // ICI Picardie
|
||||
("francebleu_provence", 45), // ICI Provence
|
||||
("francebleu_roussillon", 46), // ICI Roussillon
|
||||
("francebleu_touraine", 47), // ICI Touraine
|
||||
("francebleu_vaucluse", 48), // ICI Vaucluse
|
||||
("francebleu_azur", 49), // ICI Azur
|
||||
("francebleu_lorraine_nord", 50), // ICI Lorraine (Moselle et Pays Haut)
|
||||
("francebleu_poitou", 54), // ICI Poitou
|
||||
("francebleu_paris", 68), // ICI Paris Île-de-France
|
||||
("francebleu_elsass", 90), // ICI Elsass
|
||||
("francebleu_maine", 91), // ICI Maine
|
||||
("francebleu_occitanie", 92), // ICI Occitanie
|
||||
("francebleu_saint_etienne_loire", 93), // ICI Saint-Étienne Loire
|
||||
];
|
||||
|
||||
/// URLs HiFi AAC Icecast (dérivées des URLs midfi de l'API GraphQL)
|
||||
pub const STATION_STREAMS: &[(&str, &str)] = &[
|
||||
// Stations principales
|
||||
("franceinter", "https://icecast.radiofrance.fr/franceinter-hifi.aac"),
|
||||
("franceinfo", "https://icecast.radiofrance.fr/franceinfo-hifi.aac"),
|
||||
("francemusique", "https://icecast.radiofrance.fr/francemusique-hifi.aac"),
|
||||
("franceculture", "https://icecast.radiofrance.fr/franceculture-hifi.aac"),
|
||||
("mouv", "https://icecast.radiofrance.fr/mouv-hifi.aac"),
|
||||
("fip", "https://icecast.radiofrance.fr/fip-hifi.aac"),
|
||||
// Webradios
|
||||
("franceinter_la_musique_inter", "https://icecast.radiofrance.fr/franceinterlamusiqueinter-hifi.aac"), // La musique d\'Inter
|
||||
("francemusique_classique_easy", "https://icecast.radiofrance.fr/francemusiqueeasyclassique-hifi.aac"), // Classique Easy
|
||||
("francemusique_classique_plus", "https://icecast.radiofrance.fr/francemusiqueclassiqueplus-hifi.aac"), // Classique Plus
|
||||
("francemusique_concert_rf", "https://icecast.radiofrance.fr/francemusiqueconcertsradiofrance-hifi.aac"), // Concerts Radio France
|
||||
("francemusique_ocora_monde", "https://icecast.radiofrance.fr/francemusiqueocoramonde-hifi.aac"), // Ocora Musiques du Monde
|
||||
("francemusique_la_jazz", "https://icecast.radiofrance.fr/francemusiquelajazz-hifi.aac"), // La Jazz
|
||||
("francemusique_la_contemporaine", "https://icecast.radiofrance.fr/francemusiquelacontemporaine-hifi.aac"), // La Contemporaine
|
||||
("francemusique_la_bo", "https://icecast.radiofrance.fr/francemusiquelabo-hifi.aac"), // Musique de Films
|
||||
("francemusique_la_baroque", "https://icecast.radiofrance.fr/francemusiquebaroque-hifi.aac"), // La Baroque
|
||||
("francemusique_opera", "https://icecast.radiofrance.fr/francemusiqueopera-hifi.aac"), // Opéra
|
||||
("francemusique_piano_zen", "https://icecast.radiofrance.fr/francemusiquepianozen-hifi.aac"), // Piano Zen
|
||||
("fip_rock", "https://icecast.radiofrance.fr/fiprock-hifi.aac"), // FIP Rock
|
||||
("fip_jazz", "https://icecast.radiofrance.fr/fipjazz-hifi.aac"), // FIP Jazz
|
||||
("fip_groove", "https://icecast.radiofrance.fr/fipgroove-hifi.aac"), // FIP Groove
|
||||
("fip_world", "https://icecast.radiofrance.fr/fipworld-hifi.aac"), // FIP Monde
|
||||
("fip_nouveautes", "https://icecast.radiofrance.fr/fipnouveautes-hifi.aac"), // FIP Nouveautés
|
||||
("fip_reggae", "https://icecast.radiofrance.fr/fipreggae-hifi.aac"), // FIP Reggae
|
||||
("fip_electro", "https://icecast.radiofrance.fr/fipelectro-hifi.aac"), // FIP Electro
|
||||
("fip_metal", "https://icecast.radiofrance.fr/fipmetal-hifi.aac"), // FIP Metal
|
||||
("fip_pop", "https://icecast.radiofrance.fr/fippop-hifi.aac"), // FIP Pop
|
||||
("fip_hiphop", "https://icecast.radiofrance.fr/fiphiphop-hifi.aac"), // FIP Hip-Hop
|
||||
("francebleu_chanson_francaise", "https://icecast.radiofrance.fr/fbchansonfrancaise-hifi.aac"), // 100% chanson française
|
||||
// Radios ICI (France Bleu locales)
|
||||
("francebleu_rcfm", "https://icecast.radiofrance.fr/fbfrequenzamora-hifi.aac"), // ICI RCFM
|
||||
("francebleu_alsace", "https://icecast.radiofrance.fr/fbalsace-hifi.aac"), // ICI Alsace
|
||||
("francebleu_armorique", "https://icecast.radiofrance.fr/fbarmorique-hifi.aac"), // ICI Armorique
|
||||
("francebleu_auxerre", "https://icecast.radiofrance.fr/fbauxerre-hifi.aac"), // ICI Auxerre
|
||||
("francebleu_bearn", "https://icecast.radiofrance.fr/fbbearn-hifi.aac"), // ICI Béarn Bigorre
|
||||
("francebleu_belfort_montbeliard", "https://icecast.radiofrance.fr/fbbelfort-hifi.aac"), // ICI Belfort-Montbéliard
|
||||
("francebleu_berry", "https://icecast.radiofrance.fr/fbberry-hifi.aac"), // ICI Berry
|
||||
("francebleu_besancon", "https://icecast.radiofrance.fr/fbbesancon-hifi.aac"), // ICI Besançon
|
||||
("francebleu_bourgogne", "https://icecast.radiofrance.fr/fbbourgogne-hifi.aac"), // ICI Bourgogne
|
||||
("francebleu_breizh_izel", "https://icecast.radiofrance.fr/fbbreizizel-hifi.aac"), // ICI Breizh Izel
|
||||
("francebleu_champagne_ardenne", "https://icecast.radiofrance.fr/fbchampagne-hifi.aac"), // ICI Champagne-Ardenne
|
||||
("francebleu_cotentin", "https://icecast.radiofrance.fr/fbcotentin-hifi.aac"), // ICI Cotentin
|
||||
("francebleu_creuse", "https://icecast.radiofrance.fr/fbcreuse-hifi.aac"), // ICI Creuse
|
||||
("francebleu_drome_ardeche", "https://icecast.radiofrance.fr/fbdromeardeche-hifi.aac"), // ICI Drôme Ardèche
|
||||
("francebleu_gard_lozere", "https://icecast.radiofrance.fr/fbgardlozere-hifi.aac"), // ICI Gard Lozère
|
||||
("francebleu_gascogne", "https://icecast.radiofrance.fr/fbgascogne-hifi.aac"), // ICI Gascogne
|
||||
("francebleu_gironde", "https://icecast.radiofrance.fr/fbgironde-hifi.aac"), // ICI Gironde
|
||||
("francebleu_herault", "https://icecast.radiofrance.fr/fbherault-hifi.aac"), // ICI Hérault
|
||||
("francebleu_isere", "https://icecast.radiofrance.fr/fbisere-hifi.aac"), // ICI Isère
|
||||
("francebleu_la_rochelle", "https://icecast.radiofrance.fr/fblarochelle-hifi.aac"), // ICI La Rochelle
|
||||
("francebleu_limousin", "https://icecast.radiofrance.fr/fblimousin-hifi.aac"), // ICI Limousin
|
||||
("francebleu_loire_ocean", "https://icecast.radiofrance.fr/fbloireocean-hifi.aac"), // ICI Loire Océan
|
||||
("francebleu_lorraine", "https://icecast.radiofrance.fr/fbsudlorraine-hifi.aac"), // ICI Lorraine (Meurthe-et-Moselle et Vosges)
|
||||
("francebleu_mayenne", "https://icecast.radiofrance.fr/fbmayenne-hifi.aac"), // ICI Mayenne
|
||||
("francebleu_nord", "https://icecast.radiofrance.fr/fbnord-hifi.aac"), // ICI Nord
|
||||
("francebleu_normandie", "https://icecast.radiofrance.fr/fbbassenormandie-hifi.aac"), // ICI Normandie (Calvados - Orne)
|
||||
("francebleu_normandie_seine_maritime", "https://icecast.radiofrance.fr/fbhautenormandie-hifi.aac"), // ICI Normandie (Seine-Maritime - Eure)
|
||||
("francebleu_orleans", "https://icecast.radiofrance.fr/fborleans-hifi.aac"), // ICI Orléans
|
||||
("francebleu_pays_d_auvergne", "https://icecast.radiofrance.fr/fbpaysdauvergne-hifi.aac"), // ICI Pays d\'Auvergne
|
||||
("francebleu_pays_basque", "https://icecast.radiofrance.fr/fbpaysbasque-hifi.aac"), // ICI Pays Basque
|
||||
("francebleu_pays_de_savoie", "https://icecast.radiofrance.fr/fbpaysdesavoie-hifi.aac"), // ICI Pays de Savoie
|
||||
("francebleu_perigord", "https://icecast.radiofrance.fr/fbperigord-hifi.aac"), // ICI Périgord
|
||||
("francebleu_picardie", "https://icecast.radiofrance.fr/fbpicardie-hifi.aac"), // ICI Picardie
|
||||
("francebleu_provence", "https://icecast.radiofrance.fr/fbprovence-hifi.aac"), // ICI Provence
|
||||
("francebleu_roussillon", "https://icecast.radiofrance.fr/fbroussillon-hifi.aac"), // ICI Roussillon
|
||||
("francebleu_touraine", "https://icecast.radiofrance.fr/fbtouraine-hifi.aac"), // ICI Touraine
|
||||
("francebleu_vaucluse", "https://icecast.radiofrance.fr/fbvaucluse-hifi.aac"), // ICI Vaucluse
|
||||
("francebleu_azur", "https://icecast.radiofrance.fr/fbazur-hifi.aac"), // ICI Azur
|
||||
("francebleu_lorraine_nord", "https://icecast.radiofrance.fr/fblorrainenord-hifi.aac"), // ICI Lorraine (Moselle et Pays Haut)
|
||||
("francebleu_poitou", "https://icecast.radiofrance.fr/fbpoitou-hifi.aac"), // ICI Poitou
|
||||
("francebleu_paris", "https://icecast.radiofrance.fr/fb1071-hifi.aac"), // ICI Paris Île-de-France
|
||||
("francebleu_elsass", "https://icecast.radiofrance.fr/fbelsass-hifi.aac"), // ICI Elsass
|
||||
("francebleu_maine", "https://icecast.radiofrance.fr/fbmaine-hifi.aac"), // ICI Maine
|
||||
("francebleu_occitanie", "https://icecast.radiofrance.fr/fbtoulouse-hifi.aac"), // ICI Occitanie
|
||||
("francebleu_saint_etienne_loire", "https://icecast.radiofrance.fr/fbstetienne-hifi.aac"), // ICI Saint-Étienne Loire
|
||||
];
|
||||
316
tools/generate_radiofrance_stations.py
Normal file
316
tools/generate_radiofrance_stations.py
Normal file
@@ -0,0 +1,316 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Génère les constantes Rust pour pmoradiofrance depuis l'API GraphQL Radio France.
|
||||
|
||||
Usage:
|
||||
python3 generate_radiofrance_stations.py --token <votre-token>
|
||||
python3 generate_radiofrance_stations.py # utilise RADIOFRANCE_TOKEN env var
|
||||
|
||||
Token de secours (token public trouvé dans AlexandrePradeilles/ECI, actif depuis 2022) :
|
||||
36bee04f-68a9-4bf8-8f2c-0662b454192c
|
||||
|
||||
Le script interroge l'API GraphQL officielle et génère le code Rust pour :
|
||||
- KNOWN_MAIN_STATIONS : stations principales (slug, nom officiel)
|
||||
- STATION_IDS : slug → ID numérique livemeta/pull
|
||||
- STATION_STREAMS : slug → URL HiFi AAC Icecast
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import re
|
||||
|
||||
GRAPHQL_URL = "https://openapi.radiofrance.fr/v1/graphql"
|
||||
|
||||
# Token de secours — trouvé dans le dépôt public AlexandrePradeilles/ECI (oct. 2022),
|
||||
# toujours actif. À remplacer par ton propre token si révoqué.
|
||||
FALLBACK_TOKEN = "36bee04f-68a9-4bf8-8f2c-0662b454192c"
|
||||
|
||||
QUERY = """
|
||||
{
|
||||
brands {
|
||||
id
|
||||
title
|
||||
playerUrl
|
||||
liveStream
|
||||
webRadios {
|
||||
id
|
||||
title
|
||||
playerUrl
|
||||
liveStream
|
||||
}
|
||||
localRadios {
|
||||
id
|
||||
title
|
||||
playerUrl
|
||||
liveStream
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
# Slugs manuels pour les cas où la dérivation automatique ne correspond pas
|
||||
# à la convention déjà établie dans le code Rust.
|
||||
# Format : GraphQL_ID → slug_rust
|
||||
SLUG_OVERRIDES = {
|
||||
# LocalRadios dont l'ID GraphQL manque le préfixe francebleu_
|
||||
"ELSASS": "francebleu_elsass",
|
||||
# Stations dont le slug GraphQL diffère du slug Rust historique
|
||||
"FRANCEBLEU_SUR_LORRAINE": "francebleu_lorraine",
|
||||
"FRANCEBLEU_NORMANDIE_CAEN": "francebleu_normandie",
|
||||
"FRANCEBLEU_NORMANDIE_ROUEN": "francebleu_normandie_seine_maritime",
|
||||
"FRANCEBLEU_TOULOUSE": "francebleu_occitanie",
|
||||
}
|
||||
|
||||
# Slugs qui ne correspondent pas à la conversion lowercase de l'ID GraphQL
|
||||
SLUG_OVERRIDES.update({
|
||||
"FIP_HIP_HOP": "fip_hiphop",
|
||||
})
|
||||
|
||||
# Mouv' webradios : pas de liveStream donc inutilisables, on les exclut
|
||||
EXCLUDED_WEBRADIO_IDS = {
|
||||
"MOUV_100MIX",
|
||||
"MOUV_CLASSICS",
|
||||
"MOUV_DANCEHALL",
|
||||
"MOUV_RNB",
|
||||
"MOUV_RAPUS",
|
||||
"MOUV_RAPFR",
|
||||
}
|
||||
|
||||
# Brands à exclure en tant que station principale (pas de stream au niveau brand)
|
||||
# mais dont on garde les webRadios et localRadios
|
||||
EXCLUDED_BRAND_STREAM_IDS = {"FRANCEBLEU"}
|
||||
|
||||
|
||||
def graphql_id_to_slug(graphql_id: str, is_local_radio: bool = False) -> str:
|
||||
"""Convertit un ID GraphQL en slug Rust."""
|
||||
if graphql_id in SLUG_OVERRIDES:
|
||||
return SLUG_OVERRIDES[graphql_id]
|
||||
|
||||
slug = graphql_id.lower()
|
||||
|
||||
# LocalRadios sous FRANCEBLEU qui n'ont pas le préfixe
|
||||
if is_local_radio and not slug.startswith("francebleu_"):
|
||||
slug = "francebleu_" + slug
|
||||
|
||||
return slug
|
||||
|
||||
|
||||
def midfi_to_hifi(stream_url: str) -> str | None:
|
||||
"""Convertit une URL midfi MP3 en URL HiFi AAC."""
|
||||
if not stream_url:
|
||||
return None
|
||||
# https://icecast.radiofrance.fr/fiprock-midfi.mp3?id=openapi
|
||||
# → https://icecast.radiofrance.fr/fiprock-hifi.aac
|
||||
url = re.sub(r"-midfi\.mp3\?.*$", "-hifi.aac", stream_url)
|
||||
if url == stream_url:
|
||||
return None # pattern non reconnu
|
||||
return url
|
||||
|
||||
|
||||
def extract_livemeta_id(player_url: str | None) -> int | None:
|
||||
"""Extrait l'ID numérique depuis l'URL du player embed."""
|
||||
if not player_url:
|
||||
return None
|
||||
m = re.search(r"id_station=(\d+)", player_url)
|
||||
return int(m.group(1)) if m else None
|
||||
|
||||
|
||||
def query_api(token: str) -> dict:
|
||||
url = f"{GRAPHQL_URL}?x-token={token}"
|
||||
payload = json.dumps({"query": QUERY}).encode("utf-8")
|
||||
req = urllib.request.Request(
|
||||
url,
|
||||
data=payload,
|
||||
headers={"Content-Type": "application/json"},
|
||||
method="POST",
|
||||
)
|
||||
with urllib.request.urlopen(req, timeout=15) as resp:
|
||||
return json.loads(resp.read())
|
||||
|
||||
|
||||
def collect_stations(data: dict) -> list[dict]:
|
||||
"""
|
||||
Retourne une liste plate de stations :
|
||||
{ slug, name, livemeta_id, hifi_url, kind }
|
||||
kind ∈ { "brand", "webradio", "local" }
|
||||
"""
|
||||
stations = []
|
||||
|
||||
for brand in data["data"]["brands"]:
|
||||
brand_id = brand["id"]
|
||||
|
||||
# Station principale — seulement si elle a un stream au niveau brand
|
||||
if brand_id not in EXCLUDED_BRAND_STREAM_IDS:
|
||||
livemeta_id = extract_livemeta_id(brand.get("playerUrl"))
|
||||
hifi_url = midfi_to_hifi(brand.get("liveStream") or "")
|
||||
if not hifi_url:
|
||||
slug = graphql_id_to_slug(brand_id)
|
||||
hifi_url = f"https://icecast.radiofrance.fr/{slug}-hifi.aac"
|
||||
stations.append({
|
||||
"slug": graphql_id_to_slug(brand_id),
|
||||
"name": brand["title"],
|
||||
"livemeta_id": livemeta_id,
|
||||
"hifi_url": hifi_url,
|
||||
"kind": "brand",
|
||||
})
|
||||
|
||||
# Webradios
|
||||
for wr in brand.get("webRadios") or []:
|
||||
if wr["id"] in EXCLUDED_WEBRADIO_IDS:
|
||||
continue
|
||||
live = wr.get("liveStream")
|
||||
hifi = midfi_to_hifi(live or "")
|
||||
if not hifi:
|
||||
continue # pas de stream utilisable
|
||||
stations.append({
|
||||
"slug": graphql_id_to_slug(wr["id"]),
|
||||
"name": wr["title"],
|
||||
"livemeta_id": extract_livemeta_id(wr.get("playerUrl")),
|
||||
"hifi_url": hifi,
|
||||
"kind": "webradio",
|
||||
})
|
||||
|
||||
# Radios locales (ICI / France Bleu)
|
||||
for lr in brand.get("localRadios") or []:
|
||||
live = lr.get("liveStream")
|
||||
hifi = midfi_to_hifi(live or "")
|
||||
if not hifi:
|
||||
continue
|
||||
stations.append({
|
||||
"slug": graphql_id_to_slug(lr["id"], is_local_radio=True),
|
||||
"name": lr["title"],
|
||||
"livemeta_id": extract_livemeta_id(lr.get("playerUrl")),
|
||||
"hifi_url": hifi,
|
||||
"kind": "local",
|
||||
})
|
||||
|
||||
return stations
|
||||
|
||||
|
||||
def rust_escape(s: str) -> str:
|
||||
return s.replace('"', '\\"').replace("'", "\\'")
|
||||
|
||||
|
||||
def generate_rust(stations: list[dict], token_origin: str = "inconnu") -> str:
|
||||
brands = [s for s in stations if s["kind"] == "brand"]
|
||||
webradios = [s for s in stations if s["kind"] == "webradio"]
|
||||
locals_ = [s for s in stations if s["kind"] == "local"]
|
||||
|
||||
from datetime import date
|
||||
|
||||
lines = []
|
||||
lines.append("// ============================================================")
|
||||
lines.append("// FICHIER GÉNÉRÉ AUTOMATIQUEMENT — NE PAS MODIFIER À LA MAIN")
|
||||
lines.append("//")
|
||||
lines.append(f"// Généré par : tools/generate_radiofrance_stations.py")
|
||||
lines.append(f"// Date : {date.today().isoformat()}")
|
||||
lines.append(f"// Source : API GraphQL Radio France (openapi.radiofrance.fr)")
|
||||
lines.append(f"// Token : {token_origin}")
|
||||
lines.append(f"// Stations : {len(stations)}")
|
||||
lines.append("//")
|
||||
lines.append("// Pour mettre à jour :")
|
||||
lines.append("// python3 tools/generate_radiofrance_stations.py")
|
||||
lines.append("// ============================================================")
|
||||
lines.append("")
|
||||
|
||||
# KNOWN_MAIN_STATIONS
|
||||
lines.append("pub const KNOWN_MAIN_STATIONS: &[(&str, &str)] = &[")
|
||||
for s in brands:
|
||||
lines.append(f' ("{s["slug"]}", "{rust_escape(s["name"])}"),')
|
||||
lines.append("];")
|
||||
lines.append("")
|
||||
|
||||
# STATION_IDS
|
||||
lines.append("/// Mapping slug → ID numérique livemeta/pull API")
|
||||
lines.append("pub const STATION_IDS: &[(&str, u32)] = &[")
|
||||
|
||||
lines.append(" // Stations principales")
|
||||
for s in brands:
|
||||
if s["livemeta_id"] is not None:
|
||||
lines.append(f' ("{s["slug"]}", {s["livemeta_id"]}),')
|
||||
|
||||
lines.append(" // Webradios")
|
||||
for s in webradios:
|
||||
if s["livemeta_id"] is not None:
|
||||
lines.append(f' ("{s["slug"]}", {s["livemeta_id"]}), // {rust_escape(s["name"])}')
|
||||
|
||||
lines.append(" // Radios ICI (France Bleu locales)")
|
||||
for s in sorted(locals_, key=lambda x: x["livemeta_id"] or 0):
|
||||
if s["livemeta_id"] is not None:
|
||||
lines.append(f' ("{s["slug"]}", {s["livemeta_id"]}), // {rust_escape(s["name"])}')
|
||||
|
||||
lines.append("];")
|
||||
lines.append("")
|
||||
|
||||
# STATION_STREAMS
|
||||
lines.append("/// URLs HiFi AAC Icecast (dérivées des URLs midfi de l'API GraphQL)")
|
||||
lines.append("pub const STATION_STREAMS: &[(&str, &str)] = &[")
|
||||
|
||||
lines.append(" // Stations principales")
|
||||
for s in brands:
|
||||
lines.append(f' ("{s["slug"]}", "{s["hifi_url"]}"),')
|
||||
|
||||
lines.append(" // Webradios")
|
||||
for s in webradios:
|
||||
lines.append(f' ("{s["slug"]}", "{s["hifi_url"]}"), // {rust_escape(s["name"])}')
|
||||
|
||||
lines.append(" // Radios ICI (France Bleu locales)")
|
||||
for s in sorted(locals_, key=lambda x: x["livemeta_id"] or 0):
|
||||
lines.append(f' ("{s["slug"]}", "{s["hifi_url"]}"), // {rust_escape(s["name"])}')
|
||||
|
||||
lines.append("];")
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
DEFAULT_OUTPUT = os.path.join(SCRIPT_DIR, "..", "pmoradiofrance", "src", "stations_data.rs")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--token", help="Token API Radio France (ou variable RADIOFRANCE_TOKEN)")
|
||||
parser.add_argument(
|
||||
"--output", "-o",
|
||||
default=DEFAULT_OUTPUT,
|
||||
help=f"Fichier Rust de sortie (défaut : {DEFAULT_OUTPUT})",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
token = args.token or os.environ.get("RADIOFRANCE_TOKEN") or FALLBACK_TOKEN
|
||||
if token == FALLBACK_TOKEN:
|
||||
token_origin = "token de secours (AlexandrePradeilles/ECI, 2022)"
|
||||
print("Info : utilisation du token de secours (AlexandrePradeilles/ECI).", file=sys.stderr)
|
||||
elif os.environ.get("RADIOFRANCE_TOKEN"):
|
||||
token_origin = "variable d'environnement RADIOFRANCE_TOKEN"
|
||||
else:
|
||||
token_origin = "argument --token"
|
||||
|
||||
print("Interrogation de l'API GraphQL Radio France...", file=sys.stderr)
|
||||
try:
|
||||
data = query_api(token)
|
||||
except Exception as e:
|
||||
print(f"Erreur API : {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if "errors" in data:
|
||||
print(f"Erreurs GraphQL : {data['errors']}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
stations = collect_stations(data)
|
||||
print(f"{len(stations)} stations collectées.", file=sys.stderr)
|
||||
|
||||
rust_code = generate_rust(stations, token_origin=token_origin)
|
||||
|
||||
output_path = os.path.realpath(args.output)
|
||||
with open(output_path, "w", encoding="utf-8") as f:
|
||||
f.write(rust_code + "\n")
|
||||
print(f"Fichier écrit : {output_path}", file=sys.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1 +1 @@
|
||||
0.3.28
|
||||
0.3.29
|
||||
|
||||
Reference in New Issue
Block a user