Add Radio Browser station importer

This commit is contained in:
2026-04-26 14:33:55 +02:00
parent 7e256a669e
commit 972164bba7
14 changed files with 36414 additions and 112 deletions

611
package-lock.json generated
View File

@@ -8,11 +8,14 @@
"name": "radioplayer-web",
"version": "0.1.0",
"dependencies": {
"@vitejs/plugin-react": "^6.0.1",
"react": "^19.2.5",
"react-dom": "^19.2.5"
},
"devDependencies": {
"@types/node": "^24.10.1",
"@vitejs/plugin-react": "^6.0.1",
"tsx": "^4.20.6",
"typescript": "^5.9.3",
"vite": "^8.0.10"
}
},
@@ -20,16 +23,460 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
"integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz",
"integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz",
"integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz",
"integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz",
"integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz",
"integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz",
"integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz",
"integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz",
"integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz",
"integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz",
"integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz",
"integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz",
"integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz",
"integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==",
"cpu": [
"mips64el"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz",
"integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz",
"integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz",
"integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz",
"integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/netbsd-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz",
"integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz",
"integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz",
"integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz",
"integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/openharmony-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz",
"integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openharmony"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz",
"integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz",
"integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz",
"integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz",
"integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=18"
}
},
"node_modules/@napi-rs/wasm-runtime": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz",
"integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
@@ -48,6 +495,7 @@
"version": "0.127.0",
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz",
"integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/Boshen"
@@ -60,6 +508,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -76,6 +525,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -92,6 +542,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -108,6 +559,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -124,6 +576,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -140,6 +593,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -156,6 +610,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -172,6 +627,7 @@
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -188,6 +644,7 @@
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -204,6 +661,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -220,6 +678,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -236,6 +695,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -252,6 +712,7 @@
"cpu": [
"wasm32"
],
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
@@ -270,6 +731,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -286,6 +748,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
@@ -299,22 +762,36 @@
"version": "1.0.0-rc.7",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz",
"integrity": "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA==",
"dev": true,
"license": "MIT"
},
"node_modules/@tybys/wasm-util": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
"integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
"dev": true,
"license": "MIT",
"optional": true,
"dependencies": {
"tslib": "^2.4.0"
}
},
"node_modules/@types/node": {
"version": "24.12.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.2.tgz",
"integrity": "sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
},
"node_modules/@vitejs/plugin-react": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz",
"integrity": "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@rolldown/pluginutils": "1.0.0-rc.7"
@@ -340,15 +817,59 @@
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">=8"
}
},
"node_modules/esbuild": {
"version": "0.27.7",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz",
"integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.27.7",
"@esbuild/android-arm": "0.27.7",
"@esbuild/android-arm64": "0.27.7",
"@esbuild/android-x64": "0.27.7",
"@esbuild/darwin-arm64": "0.27.7",
"@esbuild/darwin-x64": "0.27.7",
"@esbuild/freebsd-arm64": "0.27.7",
"@esbuild/freebsd-x64": "0.27.7",
"@esbuild/linux-arm": "0.27.7",
"@esbuild/linux-arm64": "0.27.7",
"@esbuild/linux-ia32": "0.27.7",
"@esbuild/linux-loong64": "0.27.7",
"@esbuild/linux-mips64el": "0.27.7",
"@esbuild/linux-ppc64": "0.27.7",
"@esbuild/linux-riscv64": "0.27.7",
"@esbuild/linux-s390x": "0.27.7",
"@esbuild/linux-x64": "0.27.7",
"@esbuild/netbsd-arm64": "0.27.7",
"@esbuild/netbsd-x64": "0.27.7",
"@esbuild/openbsd-arm64": "0.27.7",
"@esbuild/openbsd-x64": "0.27.7",
"@esbuild/openharmony-arm64": "0.27.7",
"@esbuild/sunos-x64": "0.27.7",
"@esbuild/win32-arm64": "0.27.7",
"@esbuild/win32-ia32": "0.27.7",
"@esbuild/win32-x64": "0.27.7"
}
},
"node_modules/fdir": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12.0.0"
@@ -366,6 +887,7 @@
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"optional": true,
@@ -376,10 +898,24 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/get-tsconfig": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz",
"integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==",
"dev": true,
"license": "MIT",
"dependencies": {
"resolve-pkg-maps": "^1.0.0"
},
"funding": {
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
}
},
"node_modules/lightningcss": {
"version": "1.32.0",
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz",
"integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==",
"dev": true,
"license": "MPL-2.0",
"dependencies": {
"detect-libc": "^2.0.3"
@@ -412,6 +948,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -432,6 +969,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -452,6 +990,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -472,6 +1011,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -492,6 +1032,7 @@
"cpu": [
"arm"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -512,6 +1053,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -532,6 +1074,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -552,6 +1095,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -572,6 +1116,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -592,6 +1137,7 @@
"cpu": [
"arm64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -612,6 +1158,7 @@
"cpu": [
"x64"
],
"dev": true,
"license": "MPL-2.0",
"optional": true,
"os": [
@@ -629,6 +1176,7 @@
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
"dev": true,
"funding": [
{
"type": "github",
@@ -647,12 +1195,14 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"dev": true,
"license": "ISC"
},
"node_modules/picomatch": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
@@ -666,6 +1216,7 @@
"version": "8.5.10",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.10.tgz",
"integrity": "sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==",
"dev": true,
"funding": [
{
"type": "opencollective",
@@ -712,10 +1263,21 @@
"react": "^19.2.5"
}
},
"node_modules/resolve-pkg-maps": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
}
},
"node_modules/rolldown": {
"version": "1.0.0-rc.17",
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.17.tgz",
"integrity": "sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@oxc-project/types": "=0.127.0",
@@ -749,6 +1311,7 @@
"version": "1.0.0-rc.17",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.17.tgz",
"integrity": "sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==",
"dev": true,
"license": "MIT"
},
"node_modules/scheduler": {
@@ -761,6 +1324,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
"dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
@@ -770,6 +1334,7 @@
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
"integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==",
"dev": true,
"license": "MIT",
"dependencies": {
"fdir": "^6.5.0",
@@ -786,13 +1351,57 @@
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"dev": true,
"license": "0BSD",
"optional": true
},
"node_modules/tsx": {
"version": "4.21.0",
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz",
"integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "~0.27.0",
"get-tsconfig": "^4.7.5"
},
"bin": {
"tsx": "dist/cli.mjs"
},
"engines": {
"node": ">=18.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "7.16.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
"dev": true,
"license": "MIT"
},
"node_modules/vite": {
"version": "8.0.10",
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz",
"integrity": "sha512-rZuUu9j6J5uotLDs+cAA4O5H4K1SfPliUlQwqa6YEwSrWDZzP4rhm00oJR5snMewjxF5V/K3D4kctsUTsIU9Mw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {

View File

@@ -6,14 +6,20 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"preview": "vite preview",
"update:stations": "node scripts/update-stations.mjs",
"radio:import": "tsx scripts/import-radio-stations.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"react": "^19.2.5",
"react-dom": "^19.2.5"
},
"devDependencies": {
"@types/node": "^24.10.1",
"@vitejs/plugin-react": "^6.0.1",
"tsx": "^4.20.6",
"typescript": "^5.9.3",
"vite": "^8.0.10"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" role="img" aria-labelledby="title desc">
<title id="title">Radio placeholder</title>
<desc id="desc">Fallback icon for stations without a logo.</desc>
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#203343"/>
<stop offset="100%" stop-color="#10141b"/>
</linearGradient>
<linearGradient id="accent" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#4dd7c8"/>
<stop offset="100%" stop-color="#8fb3ff"/>
</linearGradient>
</defs>
<rect width="96" height="96" rx="24" fill="url(#bg)"/>
<rect x="17" y="20" width="62" height="56" rx="14" fill="none" stroke="url(#accent)" stroke-width="5"/>
<circle cx="36" cy="48" r="8" fill="url(#accent)"/>
<path d="M50 39h12M50 48h12M50 57h8" stroke="#f7f8fb" stroke-width="5" stroke-linecap="round"/>
<path d="M27 80c7-7 14-10 21-10s14 3 21 10" fill="none" stroke="#ffb45c" stroke-width="5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,88 @@
#!/usr/bin/env node
import { mkdir, writeFile } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { radioCountries } from '../src/radio/radioCountries.js';
import { normalizeRadioBrowserStation } from '../src/radio/radioStationNormalizer.js';
import type { RadioBrowserStation, RadioStation } from '../src/radio/radioTypes.js';
const API_ENDPOINT = 'https://de1.api.radio-browser.info/json/stations/search';
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(scriptDir, '..');
const outputPath = path.join(repoRoot, 'public', 'data', 'radio-stations.json');
const collectedStations: RadioStation[] = [];
const seenStationIds = new Set<string>();
const seenStreamUrls = new Set<string>();
const failedCountries: string[] = [];
let successfulCountries = 0;
for (const country of radioCountries) {
try {
const fetchedStations = await fetchCountryStations(country.code);
const normalizedStations = fetchedStations
.map((station) => normalizeRadioBrowserStation(station, country.name))
.filter((station): station is RadioStation => station !== null);
for (const station of normalizedStations) {
if (seenStationIds.has(station.id)) continue;
if (seenStreamUrls.has(station.streamUrl)) continue;
seenStationIds.add(station.id);
seenStreamUrls.add(station.streamUrl);
collectedStations.push(station);
}
successfulCountries += 1;
} catch (error) {
failedCountries.push(country.code);
const message = error instanceof Error ? error.message : String(error);
console.error(`[radio-import] Failed to import ${country.name} (${country.code}): ${message}`);
}
}
collectedStations.sort((left, right) => {
const countryOrder = left.country.localeCompare(right.country, undefined, { sensitivity: 'base' });
if (countryOrder !== 0) return countryOrder;
if (right.clickcount !== left.clickcount) return right.clickcount - left.clickcount;
return left.name.localeCompare(right.name, undefined, { sensitivity: 'base' });
});
await mkdir(path.dirname(outputPath), { recursive: true });
await writeFile(outputPath, `${JSON.stringify(collectedStations, null, 2)}\n`, 'utf8');
console.log(`[radio-import] Imported ${collectedStations.length} stations from ${successfulCountries}/${radioCountries.length} countries.`);
console.log(`[radio-import] Failed countries: ${failedCountries.length > 0 ? failedCountries.join(', ') : 'None'}`);
console.log('[radio-import] Output: public/data/radio-stations.json');
async function fetchCountryStations(countryCode: string): Promise<RadioBrowserStation[]> {
const url = new URL(API_ENDPOINT);
url.search = new URLSearchParams({
countrycode: countryCode,
hidebroken: 'true',
is_https: 'true',
order: 'clickcount',
reverse: 'true',
limit: '100',
}).toString();
const response = await fetch(url, {
headers: {
'user-agent': 'RadioPlayerImporter/1.0',
},
});
if (!response.ok) {
throw new Error(`${response.status} ${response.statusText}`);
}
const payload = (await response.json()) as unknown;
if (!Array.isArray(payload)) {
throw new Error('Expected an array response from Radio Browser.');
}
return payload as RadioBrowserStation[];
}

141
scripts/update-stations.mjs Normal file
View File

@@ -0,0 +1,141 @@
#!/usr/bin/env node
import { readFile, writeFile } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const DEFAULT_SOURCE_URL = 'https://data.radio.si/api/radiostations?857df78efd094abcb98c7bbb53303c3d';
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(scriptDir, '..');
const sourceUrlArg = process.argv[2];
const stationsPathArg = process.argv[3];
const sourceUrl = sourceUrlArg && !sourceUrlArg.startsWith('--') ? sourceUrlArg : DEFAULT_SOURCE_URL;
const stationsPath = stationsPathArg && !stationsPathArg.startsWith('--')
? path.resolve(process.cwd(), stationsPathArg)
: path.join(repoRoot, 'public', 'stations.json');
const [remoteStations, existingStations] = await Promise.all([
fetchJson(sourceUrl),
readJsonFile(stationsPath).catch(() => []),
]);
if (!Array.isArray(remoteStations)) {
throw new Error('Expected the radio stations API to return an array.');
}
const remoteStationsById = new Set(remoteStations.map((station) => station.id));
const existingStationsById = new Map(
existingStations
.filter((station) => station && typeof station === 'object' && typeof station.id === 'string')
.map((station) => [station.id, station]),
);
const updatedStations = remoteStations.map((remoteStation) => {
const existingStation = existingStationsById.get(remoteStation.id);
return mergeStation(existingStation, remoteStation);
}).concat(
existingStations
.filter((station) => station && typeof station === 'object' && typeof station.id === 'string' && !remoteStationsById.has(station.id))
.map(normalizeStation),
);
await writeFile(stationsPath, `${JSON.stringify(updatedStations, null, 2)}\n`, 'utf8');
console.log(`Updated ${updatedStations.length} stations in ${stationsPath}`);
async function fetchJson(url) {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Failed to fetch ${url}: ${response.status} ${response.statusText}`);
}
return response.json();
}
async function readJsonFile(filePath) {
const contents = await readFile(filePath, 'utf8');
return JSON.parse(contents);
}
function mergeStation(existingStation = {}, remoteStation) {
const assets = { ...(existingStation.assets ?? {}) };
assets.logo = remoteStation.logo;
if (remoteStation.poster) {
assets.poster = remoteStation.poster;
} else {
delete assets.poster;
}
const streams = { ...(existingStation.streams ?? {}) };
streams.audio = remoteStation.liveAudio;
if (remoteStation.liveVideo) {
streams.video = remoteStation.liveVideo;
} else {
delete streams.video;
}
const metadata = { ...(existingStation.metadata ?? {}) };
if (remoteStation.lastSongs) {
metadata.lastSongs = remoteStation.lastSongs;
}
return {
id: remoteStation.id,
name: remoteStation.title ?? existingStation.name ?? remoteStation.id,
slogan: remoteStation.slogan ?? existingStation.slogan ?? '',
category: existingStation.category ?? '',
country: existingStation.country ?? 'SI',
language: existingStation.language ?? 'sl',
region: existingStation.region ?? 'National',
tags: Array.isArray(existingStation.tags) ? existingStation.tags : [],
website: remoteStation.www ?? existingStation.website ?? null,
enabled: typeof remoteStation.enabled === 'boolean' ? remoteStation.enabled : Boolean(existingStation.enabled),
assets,
streams,
metadata,
};
}
function normalizeStation(station) {
const assets = { ...(station.assets ?? {}) };
const streams = { ...(station.streams ?? {}) };
const metadata = { ...(station.metadata ?? {}) };
if (!assets.logo) {
assets.logo = station.logo ?? '';
}
if (station.poster && !assets.poster) {
assets.poster = station.poster;
}
if (!streams.audio) {
streams.audio = station.streams?.audio ?? station.url ?? station.liveAudio ?? station.streamUrl ?? '';
}
if (!streams.video && station.liveVideo) {
streams.video = station.liveVideo;
}
return {
id: station.id,
name: station.name ?? station.title ?? station.id,
slogan: station.slogan ?? '',
category: station.category ?? '',
country: station.country ?? '',
language: station.language ?? '',
region: station.region ?? '',
tags: Array.isArray(station.tags) ? station.tags : [],
website: station.website ?? station.homepage ?? station.www ?? null,
enabled: typeof station.enabled === 'boolean' ? station.enabled : true,
assets,
streams,
metadata,
};
}

View File

@@ -115,7 +115,6 @@ function HeaderControls() {
</button>
<button id="cast-btn" className="icon-btn cast-btn" title="Cast to device" aria-label="Cast to device" type="button">
<CastIcon />
<span>Cast</span>
</button>
</div>
<div className="header-close" />
@@ -325,20 +324,74 @@ function EditorOverlay() {
);
}
function StationLibrary() {
return (
<aside id="station-library" className="station-library" aria-label="Station library">
<div className="library-top">
<div>
<p className="library-eyebrow">Browse</p>
<h2>Stations</h2>
</div>
<button id="station-library-close" className="icon-btn library-close" aria-label="Close station library" type="button">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"
strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</button>
</div>
<div className="library-filter-grid">
<label className="library-search" htmlFor="station-search-input">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2"
strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
<circle cx="11" cy="11" r="8" />
<path d="m21 21-4.3-4.3" />
</svg>
<input id="station-search-input" type="search" placeholder="Search stations" autoComplete="off" />
</label>
<label className="library-select" htmlFor="station-country-filter">
<span className="library-select-label">Country</span>
<select id="station-country-filter" defaultValue="all">
<option value="all">All countries</option>
</select>
</label>
</div>
<div className="library-tabs" role="tablist" aria-label="Station filters">
<button className="library-tab active" data-station-tab="all" type="button">All</button>
<button className="library-tab" data-station-tab="favourites" type="button">Favourites</button>
<button className="library-tab" data-station-tab="recent" type="button">Recent</button>
<button className="library-tab" data-station-tab="categories" type="button">Categories</button>
</div>
<div id="station-category-list" className="category-list" aria-label="Categories" />
<div id="station-library-summary" className="library-summary" aria-live="polite">Loading stations...</div>
<ul id="station-library-list" className="library-list" />
</aside>
);
}
export default function App() {
return (
<div className="app-container">
<main className="glass-card">
<RetroStarfield />
<HeaderControls />
<ArtworkPanel />
<TrackInfo />
<ProgressBar />
<PlayerControls />
<VolumeControl />
<StationsOverlay />
<EditorOverlay />
</main>
<div className="player-layout">
<div className="sidebar-wrap">
<StationLibrary />
</div>
<main className="glass-card">
<RetroStarfield />
<HeaderControls />
<ArtworkPanel />
<TrackInfo />
<ProgressBar />
<PlayerControls />
<VolumeControl />
<StationsOverlay />
<EditorOverlay />
</main>
</div>
</div>
);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
import type { RadioStation } from './radioTypes.js';
export async function loadRadioStations(): Promise<RadioStation[]> {
const response = await fetch('/data/radio-stations.json');
if (!response.ok) {
throw new Error(`Failed to load radio stations: ${response.status}`);
}
const stations = (await response.json()) as RadioStation[];
return Array.isArray(stations) ? stations : [];
}

View File

@@ -0,0 +1,24 @@
export const radioCountries = [
{ name: 'Austria', code: 'AT' },
{ name: 'Croatia', code: 'HR' },
{ name: 'Serbia', code: 'RS' },
{ name: 'Montenegro', code: 'ME' },
{ name: 'Bosnia & Herzegovina', code: 'BA' },
{ name: 'Germany', code: 'DE' },
{ name: 'United Kingdom', code: 'GB' },
{ name: 'Italy', code: 'IT' },
{ name: 'France', code: 'FR' },
{ name: 'Spain', code: 'ES' },
{ name: 'USA', code: 'US' },
{ name: 'Canada', code: 'CA' },
{ name: 'Australia', code: 'AU' },
{ name: 'Luxembourg', code: 'LU' },
{ name: 'Netherlands', code: 'NL' },
{ name: 'Sweden', code: 'SE' },
{ name: 'Switzerland', code: 'CH' },
{ name: 'Hungary', code: 'HU' },
{ name: 'Czechia', code: 'CZ' },
{ name: 'Poland', code: 'PL' },
] as const;
export type RadioCountry = (typeof radioCountries)[number];

View File

@@ -0,0 +1,96 @@
import type { RadioBrowserStation, RadioStation } from './radioTypes.js';
const MAX_TAGS = 12;
const OBVIOUSLY_UNSUPPORTED_CODECS = new Set([
'wma',
'wmav2',
'asf',
'ra',
'rm',
'ape',
'alac',
'amr',
]);
function trimToNull(value: string | null | undefined): string | null {
if (typeof value !== 'string') return null;
const trimmed = value.trim();
return trimmed.length > 0 ? trimmed : null;
}
function toNumber(value: number | string | null | undefined): number {
const parsed = typeof value === 'number' ? value : Number(value ?? 0);
return Number.isFinite(parsed) ? parsed : 0;
}
function toNullableNumber(value: number | string | null | undefined): number | null {
const parsed = typeof value === 'number' ? value : Number(value ?? NaN);
return Number.isFinite(parsed) && parsed >= 0 ? parsed : null;
}
function parseTags(tags: string | null | undefined): string[] {
if (typeof tags !== 'string' || tags.trim().length === 0) return [];
const seen = new Set<string>();
const parsed: string[] = [];
for (const rawTag of tags.split(',')) {
const tag = rawTag.trim();
if (!tag) continue;
const normalizedTag = tag.toLowerCase();
if (seen.has(normalizedTag)) continue;
seen.add(normalizedTag);
parsed.push(tag);
if (parsed.length >= MAX_TAGS) break;
}
return parsed;
}
function isHttpsUrl(value: string | null): value is string {
if (!value) return false;
try {
const url = new URL(value);
return url.protocol === 'https:';
} catch {
return false;
}
}
export function normalizeRadioBrowserStation(
station: RadioBrowserStation,
countryName: string,
): RadioStation | null {
const stationUuid = trimToNull(station.stationuuid);
if (!stationUuid) return null;
const name = trimToNull(station.name);
if (!name) return null;
const streamUrl = trimToNull(station.url_resolved) ?? trimToNull(station.url);
if (!isHttpsUrl(streamUrl)) return null;
const codec = trimToNull(station.codec);
if (codec && OBVIOUSLY_UNSUPPORTED_CODECS.has(codec.toLowerCase())) {
return null;
}
return {
id: stationUuid,
name,
country: trimToNull(station.country) ?? countryName,
countryCode: trimToNull(station.countrycode) ?? '',
language: trimToNull(station.language),
tags: parseTags(station.tags),
codec,
bitrate: toNullableNumber(station.bitrate),
streamUrl,
homepage: trimToNull(station.homepage),
logoUrl: trimToNull(station.favicon),
votes: toNumber(station.votes),
clickcount: toNumber(station.clickcount),
source: 'radio-browser',
sourceStationUuid: stationUuid,
};
}

34
src/radio/radioTypes.ts Normal file
View File

@@ -0,0 +1,34 @@
export type RadioBrowserStation = {
stationuuid?: string | null;
name?: string | null;
url?: string | null;
url_resolved?: string | null;
homepage?: string | null;
favicon?: string | null;
country?: string | null;
countrycode?: string | null;
language?: string | null;
tags?: string | null;
codec?: string | null;
bitrate?: number | string | null;
votes?: number | string | null;
clickcount?: number | string | null;
};
export type RadioStation = {
id: string;
name: string;
country: string;
countryCode: string;
language: string | null;
tags: string[];
codec: string | null;
bitrate: number | null;
streamUrl: string;
homepage: string | null;
logoUrl: string | null;
votes: number;
clickcount: number;
source: 'radio-browser';
sourceStationUuid: string;
};

View File

@@ -114,6 +114,9 @@ input {
button:focus-visible,
input:focus-visible,
.station-card:focus-visible,
.library-station:focus-visible,
.library-tab:focus-visible,
.category-chip:focus-visible,
.coverflow-item:focus-visible {
outline: 2px solid var(--accent);
outline-offset: 3px;
@@ -141,6 +144,421 @@ input:focus-visible,
place-items: center;
}
.player-layout {
position: relative;
isolation: isolate;
width: min(1420px, 100%);
height: clamp(680px, calc(100vh - 72px), 880px);
display: flex;
flex-direction: row;
align-items: stretch;
min-height: 0;
overflow: hidden;
}
.sidebar-wrap {
flex-shrink: 0;
width: 320px;
margin-right: 18px;
overflow: hidden;
will-change: width, margin-right;
transition:
width 0.46s cubic-bezier(0.22, 1, 0.36, 1),
margin-right 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}
.player-layout.library-collapsed .sidebar-wrap {
width: 0;
margin-right: 0;
}
.player-layout.library-collapsed {
/* desktop collapse handled by .sidebar-wrap */
}
.station-library {
position: relative;
min-width: 0;
width: 100%;
height: 100%;
min-height: 0;
max-height: 100%;
display: grid;
grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
gap: 14px;
padding: 20px;
border: 1px solid var(--border);
border-radius: 28px;
background:
linear-gradient(180deg, rgba(var(--theme-panel-rgb), 0.84), rgba(255,255,255,0.035)),
linear-gradient(140deg, rgba(var(--accent-rgb), 0.1), transparent 52%);
box-shadow: 0 24px 64px rgba(0,0,0,0.32);
backdrop-filter: blur(24px) saturate(130%);
overflow: hidden;
transform-origin: left center;
will-change: transform, opacity;
transition:
opacity 0.38s ease,
transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
filter 0.38s ease;
}
.player-layout.library-collapsed .station-library {
opacity: 0;
pointer-events: none;
transform: translateX(-18px) scale(0.97);
filter: blur(5px);
}
.library-top {
display: flex;
align-items: start;
justify-content: space-between;
gap: 12px;
}
.library-eyebrow {
margin: 0 0 4px;
color: var(--accent);
font-size: 0.74rem;
font-weight: 850;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.library-top h2 {
margin: 0;
color: var(--text-main);
font-size: 1.35rem;
line-height: 1;
}
.library-close {
display: inline-flex;
}
.library-search {
min-width: 0;
height: 44px;
display: flex;
align-items: center;
gap: 9px;
padding: 0 12px;
border: 1px solid rgba(255,255,255,0.12);
border-radius: 14px;
background: rgba(255,255,255,0.065);
color: var(--text-muted);
}
.library-filter-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) 148px;
gap: 10px;
}
.library-select {
min-width: 0;
display: grid;
gap: 6px;
}
.library-select-label {
color: var(--text-soft);
font-size: 0.72rem;
font-weight: 800;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.library-select select {
width: 100%;
min-width: 0;
height: 44px;
padding: 0 12px;
border: 1px solid rgba(255,255,255,0.12);
border-radius: 14px;
background: rgba(255,255,255,0.065);
color: var(--text-main);
font: inherit;
appearance: none;
}
.library-search input {
width: 100%;
min-width: 0;
border: 0;
outline: 0;
background: transparent;
color: var(--text-main);
font-size: 0.92rem;
}
.library-search input::placeholder {
color: var(--text-soft);
}
.library-tabs {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.library-tab {
min-width: 0;
min-height: 36px;
padding: 8px 10px;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 12px;
background: rgba(255,255,255,0.055);
color: var(--text-muted);
font-size: 0.82rem;
font-weight: 800;
transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.library-tab:hover {
transform: translateY(-1px);
border-color: var(--border-strong);
color: var(--text-main);
}
.library-tab.active {
border-color: rgba(var(--accent-rgb), 0.48);
background: rgba(var(--accent-rgb), 0.15);
color: var(--text-main);
box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.12);
}
.category-list {
display: none;
gap: 8px;
overflow-x: auto;
padding-bottom: 2px;
}
.station-library.show-categories .category-list {
display: flex;
}
.category-chip {
flex: 0 0 auto;
min-height: 32px;
padding: 7px 11px;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 999px;
background: rgba(255,255,255,0.055);
color: var(--text-muted);
font-size: 0.78rem;
font-weight: 800;
}
.category-chip.active {
border-color: rgba(var(--accent-rgb), 0.5);
background: rgba(var(--accent-rgb), 0.16);
color: var(--text-main);
}
.library-summary {
min-height: 18px;
color: var(--text-soft);
font-size: 0.78rem;
font-weight: 700;
}
.library-list {
min-height: 0;
margin: 0;
padding: 2px 8px 2px 0;
list-style: none;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: rgba(var(--accent-rgb), 0.72) rgba(255,255,255,0.06);
mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.library-list::-webkit-scrollbar {
width: 12px;
}
.library-list::-webkit-scrollbar-track {
margin-block: 6px;
border-radius: 999px;
background:
linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-3-rgb), 0.08)),
rgba(255,255,255,0.045);
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.library-list::-webkit-scrollbar-thumb {
min-height: 56px;
border: 3px solid transparent;
border-radius: 999px;
background:
linear-gradient(180deg, var(--accent), var(--accent-3)) padding-box,
rgba(255,255,255,0.12) border-box;
box-shadow:
0 0 16px rgba(var(--accent-rgb), 0.24),
inset 0 0 0 1px rgba(255,255,255,0.18);
}
.library-list::-webkit-scrollbar-thumb:hover {
background:
linear-gradient(180deg, var(--accent), var(--accent-2)) padding-box,
rgba(255,255,255,0.18) border-box;
}
.library-empty {
padding: 18px 14px;
border: 1px dashed rgba(255,255,255,0.16);
border-radius: 16px;
color: var(--text-muted);
font-size: 0.88rem;
line-height: 1.35;
background: rgba(255,255,255,0.035);
}
.library-station {
width: 100%;
min-width: 0;
min-height: 72px;
display: grid;
grid-template-columns: 48px minmax(0, 1fr) 34px;
gap: 11px;
align-items: center;
margin-bottom: 10px;
padding: 10px;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 17px;
background: rgba(255,255,255,0.052);
color: var(--text-main);
text-align: left;
cursor: pointer;
transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.library-station:hover {
transform: translateY(-1px);
border-color: var(--border-strong);
background: rgba(255,255,255,0.085);
}
.library-station.current {
border-color: rgba(var(--accent-rgb), 0.56);
background:
linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-3-rgb), 0.1)),
rgba(255,255,255,0.05);
}
.library-station-logo,
.library-station-fallback {
width: 48px;
height: 48px;
border-radius: 14px;
background: rgba(255,255,255,0.08);
}
.library-station-logo {
object-fit: contain;
padding: 7px;
}
.library-station-fallback {
display: flex;
align-items: center;
justify-content: center;
color: var(--text-main);
font-size: 1rem;
font-weight: 850;
}
.library-station-copy {
min-width: 0;
display: grid;
gap: 6px;
}
.library-station-title {
overflow: hidden;
color: var(--text-main);
font-size: 0.94rem;
font-weight: 850;
line-height: 1.12;
text-overflow: ellipsis;
white-space: nowrap;
}
.library-station-meta {
display: flex;
flex-wrap: wrap;
min-width: 0;
align-items: center;
gap: 7px;
color: var(--text-muted);
font-size: 0.76rem;
font-weight: 700;
}
.library-station-country,
.library-station-tech {
flex: 0 0 auto;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.library-station-tech {
color: var(--text-soft);
}
.library-station-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.library-tag {
max-width: 100%;
padding: 4px 8px;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 999px;
background: rgba(255,255,255,0.045);
color: var(--text-main);
font-size: 0.7rem;
font-weight: 700;
line-height: 1.2;
}
.library-tag.muted {
color: var(--text-soft);
}
.favorite-btn {
width: 34px;
height: 34px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid rgba(255,255,255,0.11);
border-radius: 12px;
background: rgba(255,255,255,0.055);
color: var(--text-soft);
font-size: 1.06rem;
line-height: 1;
cursor: pointer;
transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.favorite-btn:hover {
transform: scale(1.05);
color: var(--text-main);
}
.favorite-btn.active {
border-color: rgba(var(--accent-2-rgb), 0.48);
background: rgba(var(--accent-2-rgb), 0.14);
color: var(--accent-2);
}
.starfield {
position: absolute;
inset: 0;
@@ -238,12 +656,12 @@ input:focus-visible,
.glass-card {
position: relative;
z-index: 1;
z-index: 2;
overflow: hidden;
width: min(1060px, 100%);
max-width: 100%;
flex: 1 1 0;
min-width: 0;
min-height: min(720px, calc(100vh - 48px));
height: 100%;
min-height: 0;
display: grid;
grid-template-columns: minmax(300px, 0.92fr) minmax(340px, 1.08fr);
grid-template-areas:
@@ -263,14 +681,31 @@ input:focus-visible,
linear-gradient(180deg, rgba(var(--theme-panel-rgb), 0.72), rgba(255,255,255,0.03));
box-shadow: var(--shadow);
backdrop-filter: blur(26px) saturate(135%);
transition: background 0.45s ease, border-color 0.45s ease;
transform: translateY(-4px) scale(0.993);
transform-origin: center center;
will-change: transform;
transition:
background 0.45s ease,
border-color 0.45s ease,
box-shadow 0.46s cubic-bezier(0.22, 1, 0.36, 1),
transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}
.glass-card > :not(.starfield) {
.player-layout.library-collapsed .glass-card {
transform: translateY(0) scale(1);
box-shadow: 0 24px 56px rgba(0,0,0,0.28);
}
.glass-card > :not(.starfield):not(.overlay) {
position: relative;
z-index: 2;
}
.glass-card > .overlay {
position: fixed;
z-index: 1000;
}
header {
grid-area: header;
}
@@ -1087,7 +1522,6 @@ input[type=range]::-webkit-slider-thumb {
.cast-btn,
.install-btn {
width: auto;
min-width: 82px;
padding: 0 12px;
gap: 8px;
}
@@ -1109,13 +1543,69 @@ input[type=range]::-webkit-slider-thumb {
background: rgba(143,179,255,0.14);
}
@media (max-width: 1100px) {
body.library-open {
overflow: hidden;
}
.player-layout {
height: auto;
min-height: min(720px, calc(100vh - 48px));
width: min(1060px, 100%);
}
.player-layout.library-collapsed {
width: min(1060px, 100%);
}
.sidebar-wrap {
display: contents;
}
.station-library {
position: fixed;
left: 12px;
right: 12px;
bottom: 12px;
z-index: 1200;
min-height: 0;
height: auto;
max-height: min(82vh, 720px);
grid-template-rows: auto auto auto auto auto minmax(240px, 1fr);
padding: 18px;
border-radius: 24px;
transform: translateY(calc(100% + 24px));
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: transform 0.24s ease, opacity 0.24s ease, visibility 0.24s ease;
}
.station-library.open {
transform: translateY(0);
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.library-close {
display: inline-flex;
}
}
@media (max-width: 760px) {
.app-container {
align-items: start;
padding: 10px;
}
.player-layout {
width: 100%;
min-height: 0;
}
.glass-card {
height: auto;
min-height: calc(100vh - 20px);
width: 100%;
grid-template-columns: 1fr;
@@ -1131,6 +1621,58 @@ input[type=range]::-webkit-slider-thumb {
border-radius: 22px;
}
.station-library {
left: 8px;
right: 8px;
bottom: 8px;
max-height: 86vh;
padding: 15px;
border-radius: 22px;
gap: 11px;
}
.library-top h2 {
font-size: 1.18rem;
}
.library-tabs {
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 6px;
overflow-x: auto;
}
.library-filter-grid {
grid-template-columns: 1fr;
}
.library-tab {
min-width: 82px;
min-height: 34px;
padding-inline: 8px;
font-size: 0.76rem;
}
.library-station {
min-height: 66px;
grid-template-columns: 44px minmax(0, 1fr) 32px;
gap: 9px;
padding: 9px;
border-radius: 15px;
}
.library-station-logo,
.library-station-fallback {
width: 44px;
height: 44px;
border-radius: 13px;
}
.favorite-btn {
width: 32px;
height: 32px;
border-radius: 11px;
}
.brand-block {
gap: 9px;
}

16
tsconfig.json Normal file
View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"verbatimModuleSyntax": true,
"isolatedModules": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts", "scripts/**/*.ts"]
}