Jellycleanarr
A Terminal User Interface (TUI) for viewing Jellyfin media playback statistics. Jellycleanarr connects to your Jellyfin server and displays detailed analytics about media consumption across users, series, and libraries.
Features
- User Statistics: View most and least active users with play counts and watch duration
- Series Statistics: See which series and movies are most/least watched
- Library Statistics: Analyze playback activity across your media libraries
- Tabbed Interface: Easy navigation between different stat views
- Real-time Data: Refresh statistics on demand with a single keypress
- Modern TUI: Beautiful terminal interface powered by Textual
Requirements
- Python 3.10 or higher
- Jellyfin server with the Playback Reporting Plugin installed
- Jellyfin API key
Installation
Using Poetry (Recommended)
# Clone the repository
git clone https://github.com/yourusername/jellycleanarr.git
cd jellycleanarr
# Install dependencies
poetry install
# Run the application
poetry run jellycleanarr
Using pip
# Clone the repository
git clone https://github.com/yourusername/jellycleanarr.git
cd jellycleanarr
# Install dependencies
pip install -e .
# Run the application
jellycleanarr
Configuration
-
Copy the example environment file:
cp .env.example .env -
Edit
.envand configure your Jellyfin settings:JELLYFIN_ADDRESS=https://your-jellyfin-server.com JELLYFIN_API_KEY=your_api_key_here
Getting a Jellyfin API Key
- Open your Jellyfin web interface
- Go to Dashboard → API Keys
- Click "+" to create a new API key
- Give it a name (e.g., "Jellycleanarr")
- Copy the generated key to your
.envfile
Usage
Run the application:
# With Poetry
poetry run jellycleanarr
# With pip install
jellycleanarr
# As a Python module
python -m jellycleanarr
Keyboard Shortcuts
1- Switch to User Statistics tab2- Switch to Series Statistics tab3- Switch to Library Statistics tabr- Refresh current tab dataq- Quit applicationTab- Navigate between tabs- Arrow keys - Navigate within tables
Features by Tab
User Statistics Tab
- Most Active Users: Users with the highest play counts
- Least Active Users: Users with the lowest play counts
- Displays: Username, total plays, watch duration, unique items watched
Series Statistics Tab
- Most Watched Series: Series/movies with the highest play counts
- Least Watched Series: Series/movies with the lowest play counts
- Displays: Title, total plays, watch duration, unique users
Library Statistics Tab
- Most Active Libraries: Libraries with the highest playback activity
- Least Active Libraries: Libraries with the lowest playback activity
- Displays: Library name, total plays, watch duration, unique users, item count
Development
Project Structure
jellycleanarr/
├── src/jellycleanarr/
│ ├── api/ # Jellyfin API client
│ ├── models/ # Data models
│ ├── services/ # Business logic
│ ├── ui/ # TUI components
│ │ ├── screens/ # App screens
│ │ ├── widgets/ # UI widgets
│ │ └── styles/ # CSS styling
│ └── utils/ # Utility functions
├── tests/ # Test suite
└── pyproject.toml # Project dependencies
Running Tests
poetry run pytest
Code Formatting
# Format code with Black
poetry run black src/
# Lint with Ruff
poetry run ruff check src/
# Type checking with mypy
poetry run mypy src/
Troubleshooting
Connection Errors
If you get connection errors:
- Verify
JELLYFIN_ADDRESSis correct and includeshttps://orhttp:// - Check that your Jellyfin server is accessible
- Ensure the API key is valid
Authentication Errors
If authentication fails:
- Verify your API key is correct
- Check that the API key hasn't been revoked in Jellyfin
- Try creating a new API key
No Data Displayed
If statistics don't show:
- Ensure the Playback Reporting Plugin is installed and enabled
- Check that there is playback activity recorded in your Jellyfin server
- Try refreshing the data with the
rkey
Dependencies
- Textual - Modern TUI framework
- httpx - Async HTTP client
- Pydantic - Data validation
- python-dotenv - Environment variable management
License
MIT License - See LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Acknowledgments
- Built with Textual
- Integrates with Jellyfin
- Uses the Jellyfin Playback Reporting Plugin
Description
Languages
Python
62.3%
JavaScript
27%
CSS
6.4%
HTML
4.3%