82 lines
2.4 KiB
Markdown
82 lines
2.4 KiB
Markdown
# Karaokatalog
|
||
|
||
Tools to manage an UltraStar DX song library. Features include:
|
||
|
||
1. Web-based catalogue UI
|
||
2. Deduplication
|
||
3. Organization
|
||
4. Recoding
|
||
5. Jsonification
|
||
|
||
## Setup
|
||
|
||
```bash
|
||
python3 -m venv venv
|
||
source venv/bin/activate
|
||
pip install -r requirements.txt
|
||
```
|
||
|
||
## Run
|
||
|
||
We assume that your song library is stored at `$SONG_LIBRARY`. Replace this placeholder when running the command, or just set the variable, e.g., like this:
|
||
|
||
```bash
|
||
export SONG_LIBRARY=/path/to/library
|
||
```
|
||
|
||
### Web-based catalogue UI
|
||
|
||
**Launch server for a web-based UI to browse the catalogue**, supporting to create a list of favorites.
|
||
|
||
ℹ️ This is completely risk-free, as it does not change files.
|
||
|
||
```bash
|
||
python3 -m karaokatalog.ui.serve $SONG_LIBRARY
|
||
```
|
||
|
||
To speed up the start, use jsonification to create and persist a JSON of all songs in the library root dir before starting this UI.
|
||
|
||
### Deduplication
|
||
|
||
**Find and delete exactly duplicated songs**, i.e., songs with the same title and artist that also consist of exactly the same files in the directory.
|
||
|
||
⚠️ This will _irreversibly_ delete all song folders it considers to be exact duplicates.
|
||
|
||
ℹ️ Deduplication is (mostly) risk-free: As it only deletes exact duplicates, you will not lose any data (given that I've made no programming errors, which is why the operation is only _mostly_ risk-free).
|
||
|
||
```bash
|
||
python3 -m karaokatalog.deduplicate $SONG_LIBRARY
|
||
```
|
||
|
||
### Organization
|
||
|
||
**Rename/move every song folder to `$SONG_LIBRARY/<artist>/<title>`.** If such a folder already exists, a number is appended to distinguish.
|
||
|
||
ℹ️ Moving will not overwrite already existing files, the operation is therefore risk-free.
|
||
|
||
```bash
|
||
python3 -m karaokatalog.organize $SONG_LIBRARY
|
||
```
|
||
|
||
### Recoding
|
||
|
||
**Re-encode all txt files into UTF-8.** This will use normal UTF-8, i.e., UTF-8 without BOM. If the txt uses UTF-8 with BOM, BOM is removed.
|
||
|
||
⚠️ This will _irreversibly_ change the encoding of the txt files (based on a guessed encoding).
|
||
|
||
ℹ️ Deduplication is risk-reduced: We only change the encoding if we are reasonably certain our guessed encoding is correct. However, we could still make mistakes when detecting.
|
||
|
||
```bash
|
||
python3 -m karaokatalog.recode $SONG_LIBRARY
|
||
```
|
||
|
||
### Jsonification
|
||
|
||
**Create a `songs.json` file with some song metadata in the root library dir.**
|
||
|
||
ℹ️ This operation is risk-free: If a `songs.json` already exists, it is kept intact (so no data loss possible).
|
||
|
||
```bash
|
||
python3 -m karaokatalog.jsonify $SONG_LIBRARY
|
||
```
|