mirror of
https://github.com/jhbruhn/jellyfin-radio.git
synced 2025-03-14 19:45:50 +00:00
Add Readme, filter out songs with too many channels
This commit is contained in:
parent
1ad44d172c
commit
b862d08167
3 changed files with 30 additions and 1 deletions
25
README.md
Normal file
25
README.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# jellyfin-radio
|
||||
|
||||
Ever dreamt of having your own radio station, but without the hassle of choosing the music yourself?
|
||||
|
||||
jellyfin-radio randomly plays Songs from a Jellyfin collection and streams it via .mp3, which can be streamed for example on a Yamaha MusicCast System.
|
||||
|
||||
The usage is rather simple. It is recommended to run this as a Docker container. An example docker-compose configuration might look like this:
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
services:
|
||||
radio:
|
||||
image: ghcr.io/jhbruhn/jellyfin-radio:main
|
||||
ports:
|
||||
- "3000:3000"
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
JELLYFIN_URL: http://<jellyfin-server>:<jellyfin-port>
|
||||
JELLYFIN_API_KEY: <api-key> # generated in jellyfin UI
|
||||
JELLYFIN_COLLECTION_NAME: Music # name of the Collection you want to play music from
|
||||
SONG_PREFETCH: 2 # optional: Define how many songs jellyfin-radio should fetch in advance
|
||||
```
|
||||
|
||||
# License
|
||||
MIT
|
|
@ -1,3 +1,4 @@
|
|||
use awedio::Sound;
|
||||
use bytes::Buf;
|
||||
use serde::Deserialize;
|
||||
|
||||
|
@ -154,7 +155,7 @@ impl JellyfinClient {
|
|||
Box::new(symphonia::core::io::ReadOnlySource::new(body.reader())),
|
||||
extension.as_deref(),
|
||||
)?);
|
||||
|
||||
|
||||
Ok(decoder)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,9 @@ async fn main() -> anyhow::Result<()> {
|
|||
println!("Fetching {} - {}", item.artists.join(","), item.name);
|
||||
let sound = client.fetch_audio(item).await?;
|
||||
println!("Fetched Song!");
|
||||
if sound.channel_count() > 2 {
|
||||
anyhow::bail!("Too many channels");
|
||||
}
|
||||
controller.add(Box::new(sound));
|
||||
anyhow::Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue