📝 | Update README.md
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 27s

This commit is contained in:
2026-05-31 23:38:45 +03:00
parent 079afdf124
commit 5f417396ff
2 changed files with 61 additions and 54 deletions

115
README.md
View File

@@ -2,111 +2,118 @@
[![Quality Gate Status](https://sonarqube.huitsinnevada.fi/api/project_badges/measure?project=Tunetti&metric=alert_status&token=sqb_a08ffa8615e77ac20c6f7e0aa58a93e643a85666)](https://sonarqube.huitsinnevada.fi/dashboard?id=Tunetti)
A desktop YouTube Music player built with Python and Qt6. Search, play, and manage your music library — all from a native GUI, no browser needed.
A desktop YouTube Music player — search, play, and manage your music without opening a browser. 🖥️
> **Disclaimer:** This project is approximately 99% AI-generated code.
<p align="center">
<img src="docs/screenshots/screenshot-1.avif" alt="Tunetti screenshot" width="800">
</p>
> ### 🤖 A note about this project
>
> This project is **approximately 99% AI-generated code**. It was created by prompting large language models — not by hand. The code works, but it may not follow every best practice you'd expect from hand-written software. Contributions, bug reports, and suggestions are very welcome! 🙏
---
## Features
## ✨ What can it do?
- **YouTube Music search & playback** Search songs, albums, and artists directly from the app.
- **Rich Qt6 GUI** Sleek, dark-themed interface with custom widgets (glassmorphism cards, animated nav buttons, smooth sidebar).
- **Discord Rich Presence** Shows what you're listening to on your Discord profile.
- **Play history & statistics** Every play is logged. View your most-played tracks, play counts by day, and listening trends.
- **Favourites** Mark songs as favourites and quickly access them.
- **Audio visualizer** Real-time FFT-based spectrum analyser that reacts to the current playback.
- **Playback controls** Play, pause, skip, seek, volume, mute, loop, and queue management.
- **Configurable** Settings stored in `~/.config/tunetti/config.json` (XDG-compliant). Volume, Discord RPC toggle, visualizer toggle, and more.
- **Lightweight** Downloads audio on-the-fly via yt-dlp; no permanent music library to store.
- **🎶 YouTube Music search & playback** — Find songs, albums, and artists right from the app.
- **🎧 Play music in the background** — Keep listening while you work.
- **🎨 Good-looking interface** — Dark theme with a modern, clean design.
- **🎤 Discord Rich Presence** — Show your friends what you're listening to.
- **📊 Play history & stats** — See your most-played tracks, listening trends, and daily counts.
- **⭐ Favourites** — Save songs you love and find them again instantly.
- **📈 Audio visualizer** — A colorful spectrum display that moves with the music.
- **⏯️ Full playback controls** — Play, pause, skip, seek, volume, loop, shuffle, and queue.
- **⚙️ Configurable** — Toggle Discord RPC, visualizer, and more in settings.
- **💾 Lightweight** — Streams audio on demand; no big music library to store.
---
## Requirements
## 📋 What you'll need
- **Python 3.10+**
- A **PulseAudio** or **PipeWire** audio system (Linux)
- **FFmpeg** installed and available in `PATH`
- **Python 3.10 or newer**
- **Linux** with **PulseAudio** or **PipeWire** for sound
- **FFmpeg** installed and on your `PATH`
## Installation
## 🚀 Getting started
```bash
# Clone the repository
git clone https://github.com/your-org/tunetti.git
cd tunetti
# Download the code
git clone https://git.huitsinnevada.fi/NikkeDoy/Tunetti.git
cd Tunetti
# Create and activate a virtual environment
# Set up a virtual environment
python -m venv .venv
source .venv/bin/activate
# Install dependencies
# Install everything
pip install -r requirements.txt
```
> **Note:** `PySide6` provides the Qt6 bindings. On some distributions you may need to install system packages like `libegl1` or `libxkbcommon0` as well.
> ⚠️ You might also need system packages like `libegl1` or `libxkbcommon0` — your package manager will tell you what's missing.
## Usage
### ▶️ Running Tunetti
```bash
# Normal mode
python main.py
# Verbose/debug mode (shows yt-dlp and Qt FFmpeg internals)
# Debug mode (see what's happening under the hood)
TUNETTI_VERBOSE=1 python main.py
```
On first launch, Tunetti creates `~/.config/tunetti/` and populates it with default settings.
On first launch, Tunetti creates `~/.config/tunetti/` and sets everything up for you.
### Environment Variables
### 🔧 Environment variables
| Variable | Description |
| Variable | What it does |
|---|---|
| `TUNETTI_VERBOSE` | Set to `1`, `true`, or `yes` to enable debug logging. |
| `TUNETTI_VERBOSE` | Set to `1`, `true`, or `yes` to see detailed debug logs. |
---
## Project Structure
## 📁 How the code is organized
```
Tunetti/
├── main.py # Entry point & logging setup
├── gui.py # All UI components (window, search, playback bar, visualizer, stats, settings)
├── player.py # Audio playback, download workers, queue management
├── config.py # XDG-compliant configuration loader & migrator
├── music_db.py # SQLite database layer (history, favourites, stats)
├── discord_rpc.py # Discord Rich Presence integration via pypresence
├── requirements.txt # Python dependencies
├── sonar-project.properties # SonarQube analysis config
├── main.py # App start & logging
├── gui.py # All the visual stuff (window, search bar, visualizer, stats, settings)
├── player.py # Audio playback, downloads, queue
├── config.py # Settings loader
├── music_db.py # History, favourites, stats database
├── discord_rpc.py # Discord integration
├── requirements.txt # List of Python packages needed
├── sonar-project.properties
└── .gitea/
└── workflows/
└── sonar.yaml # Gitea Actions CI pipeline
└── sonar.yaml # Automated code checks
```
## Configuration
## ⚙️ Settings
Settings are persisted in `~/.config/tunetti/config.json` and include:
Tunetti stores its settings in `~/.config/tunetti/config.json`. Here's what you can change:
| Key | Default | Description |
| Setting | Default | What it does |
|---|---|---|
| `volume` | `50` | Playback volume (0100) |
| `max_history` | `5000` | Maximum history entries |
| `discord_rpc_enabled` | `true` | Enable Discord Rich Presence |
| `visualizer_enabled` | `true` | Enable the audio spectrum visualizer |
| `db_path` | `~/.config/tunetti/music_history.db` | SQLite database location |
| `max_history` | `5000` | Max number of plays to remember |
| `discord_rpc_enabled` | `true` | Show what you're listening to on Discord |
| `visualizer_enabled` | `true` | Show the audio spectrum visualizer |
| `db_path` | `~/.config/tunetti/music_history.db` | Where the database is stored |
## Dependencies
## 📦 What's under the hood
| Package | Purpose |
| Package | What it's used for |
|---|---|
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | YouTube audio download & search |
| [ytmusicapi](https://github.com/sigma67/ytmusicapi) | YouTube Music search API |
| [PySide6](https://pypi.org/project/PySide6/) | Qt6 GUI framework |
| [yt-dlp](https://github.com/yt-dlp/yt-dlp) | Downloads audio from YouTube |
| [ytmusicapi](https://github.com/sigma67/ytmusicapi) | Searches YouTube Music |
| [PySide6](https://pypi.org/project/PySide6/) | The graphical interface (Qt6) |
| [pypresence](https://github.com/qwertyquerty/pypresence) | Discord Rich Presence |
## CI / Quality
## 🧪 Quality checks
The project uses SonarQube for static analysis, with a Gitea Actions workflow defined in `.gitea/workflows/sonar.yaml`.
Code quality is analyzed automatically by SonarQube whenever changes are pushed.
## License
## 📄 License
See [LICENSE](./LICENSE).