|
@@ -0,0 +1,69 @@
|
|
|
+# Jellyfin Daily Mix
|
|
|
+
|
|
|
+## Overview
|
|
|
+`jellyfin-daily-mix` is a Python script that automatically generates a daily playlist in Jellyfin based on the least-played songs from selected users. The script ensures a fresh and balanced mix of songs by considering individual and combined play counts across multiple users.
|
|
|
+
|
|
|
+## Features
|
|
|
+- Fetches user-specific play history from a Jellyfin server.
|
|
|
+- Selects a specified number of least-played songs across users.
|
|
|
+- Automatically updates an existing playlist or creates a new one if it doesn't exist.
|
|
|
+- Ensures songs are fairly distributed among users.
|
|
|
+- Uses Jellyfin's API for seamless integration.
|
|
|
+
|
|
|
+## Requirements
|
|
|
+- Python 3.8+
|
|
|
+- A running Jellyfin server
|
|
|
+- API access to Jellyfin
|
|
|
+- `dotenv` package for environment variable management
|
|
|
+- `jellyfin_api_client` for interacting with Jellyfin
|
|
|
+
|
|
|
+## Installation
|
|
|
+
|
|
|
+1. Clone the repository:
|
|
|
+ ```sh
|
|
|
+ git clone https://gogs.justprojects.de/subDesTagesMitExtraKaese/jellyfin-daily-mix.git
|
|
|
+ cd jellyfin-daily-mix
|
|
|
+ ```
|
|
|
+
|
|
|
+2. Install dependencies:
|
|
|
+ ```sh
|
|
|
+ pip install -r requirements.txt
|
|
|
+ ```
|
|
|
+
|
|
|
+3. Create a `.env` file with the following environment variables:
|
|
|
+ ```ini
|
|
|
+ SERVER_URL=<your_jellyfin_server_url>
|
|
|
+ API_TOKEN=<your_api_token>
|
|
|
+ HOSTNAME=<your_device_name>
|
|
|
+ USER_NAMES="user1 user2 user3"
|
|
|
+ PLAYLIST="Daily Mix"
|
|
|
+ ITEM_COUNT=50
|
|
|
+ ```
|
|
|
+
|
|
|
+## Usage
|
|
|
+Run the script with:
|
|
|
+```sh
|
|
|
+python main.py
|
|
|
+```
|
|
|
+
|
|
|
+The script will:
|
|
|
+1. Retrieve the list of users specified in `USER_NAMES`.
|
|
|
+2. Fetch their least-played songs.
|
|
|
+3. Update or create a playlist named `Daily Mix` with a fresh selection of songs.
|
|
|
+
|
|
|
+## Logging & Debugging
|
|
|
+- The script logs API calls and raises exceptions for failed requests.
|
|
|
+- To enable debugging, print statements provide insights into song selection and API interactions.
|
|
|
+
|
|
|
+## Contribution
|
|
|
+Feel free to submit issues or pull requests if you have improvements or feature suggestions.
|
|
|
+
|
|
|
+## License
|
|
|
+MIT License. See `LICENSE` for details.
|
|
|
+
|
|
|
+## Acknowledgments
|
|
|
+- [Jellyfin API](https://api.jellyfin.org) for providing the backend capabilities.
|
|
|
+- Python's `httpx` and `dotenv` for API requests and environment management.
|
|
|
+
|
|
|
+Happy listening! 🎵
|
|
|
+
|