Skip to content

Commit

Permalink
docs: update quickstart documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanljones committed Oct 24, 2023
1 parent b0ba0cf commit 3de0be8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 53 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pioneers Rekordbox DJ Software. It currently supports
- Analysis files (ANLZ)
- My-Setting files

Tested Rekordbox versions: ``5.8.6 | 6.5.3``
Tested Rekordbox versions: ``5.8.6 | 6.5.3 | 6.7.7``


|⚠️| This project is still under development and might contain bugs or have breaking API changes in the future. |
Expand Down Expand Up @@ -238,6 +238,8 @@ sync = mysett.get("sync")
quant = mysett.get("quantize")
````

The `DEVSETTING.DAT` file is still not supported


## 💡 File formats

Expand Down
8 changes: 2 additions & 6 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ Pioneer's Rekordbox DJ Software. It currently supports
- Analysis files (ANLZ)
- My-Settings files

Tested Rekordbox versions: `5.8.6 | 6.5.3`

Starting from version `6.6.5` Pioneer obfuscated the `app.asar` file contents, breaking
the key extraction (see [this issue][issue] and the Rekordbox 6 database section for
more details).
Tested Rekordbox versions: `5.8.6 | 6.5.3 | 6.7.7`

```{warning}
This project is still under development and might contain bugs or
Expand All @@ -59,10 +55,10 @@ maxdepth: 2
caption: File formats
---
formats/db6
formats/xml
formats/anlz
formats/mysetting
formats/db6
```

```{toctree}
Expand Down
113 changes: 68 additions & 45 deletions docs/source/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@ from pyrekordbox import show_config

show_config()
````

which, for example, will print
````
Pioneer:
app_dir = C:\Users\user\AppData\Roaming\Pioneer
install_dir = C:\Program Files\Pioneer
Rekordbox 5:
app_dir = C:\Users\user\AppData\Roaming\Pioneer\rekordbox
install_dir = C:\Program Files\Pioneer\rekordbox 5.8.6
...
````

If for some reason the configuration fails the values can be updated by providing the
paths to the directory where Pioneer applications are installed (`pioneer_install_dir`)
and to the directory where Pioneer stores the application data (`pioneer_app_dir`)
Expand All @@ -45,12 +33,65 @@ from pyrekordbox.config import update_config

update_config("<pioneer_install_dir>", "<pioneer_app_dir>")
````

Alternatively the two paths can be specified in a configuration file under the section
`rekordbox`. Supported configuration files are pyproject.toml, setup.cfg, pyrekordbox.toml,
pyrekordbox.cfg and pyrekordbox.yaml.


## Rekordbox 6 database

Rekordbox 6 now uses a SQLite database for storing the collection content.
Unfortunatly, the new `master.db` SQLite database is encrypted using
[SQLCipher][sqlcipher], which means it can't be used without the encryption key.
However, since your data is stored and used locally, the key must be present on the
machine running Rekordbox.

Pyrekordbox can unlock the new Rekordbox `master.db` SQLite database and provides
an easy interface for accessing the data stored in it:

````python
from pyrekordbox import Rekordbox6Database

db = Rekordbox6Database()

for content in db.get_content():
print(content.Title, content.Artist.Name)

playlist = db.get_playlist()[0]
for song in playlist.Songs:
content = song.Content
print(content.Title, content.Artist.Name)
````
Fields in the Rekordbox database that are stored without linking to other tables
can be changed via the corresponding property of the object:
````python
content = db.get_content()[0]
content.Title = "New Title"
````
Some fields are stored as references to other tables, for example the artist of a track.
Check the [documentation](#db6-format) of the corresponding object for more information.
So far only a few tables support adding or deleting entries:
- ``DjmdPlaylist``: Playlists/Playlist Folders
- ``DjmdSongPlaylist``: Songs in a playlist

````{important}
Starting from Rekordbox version ``6.6.5`` Pioneer obfuscated the ``app.asar`` file
contents, breaking the key extraction (see [this discussion](https://github.com/dylanljones/pyrekordbox/discussions/97) for more details).
If you are using a later version of Rekorbox and have no cached key from a previous
version, the database can not be unlocked automatically.
The command line interface of ``pyrekordbox`` provides a command for downloading
the key from known sources and writing it to the cache file:
```shell
python -m pyrekordbox download-key
```
Once the key is cached the database can be opened without providing the key.
The key can also be provided manually:
```python
db = Rekordbox6Database(key="<insert key here>")
```
````


## Rekordbox XML

The Rekordbox XML database is used for importing (and exporting) Rekordbox collections
Expand Down Expand Up @@ -107,6 +148,17 @@ Changing and creating the Rekordbox analysis files is planned as well, but for t
full structure of the analysis files has to be understood.


```{note}
Some ANLZ tags are still unsupported:
- PCOB
- PCO2
- PSSI
- PWV6
- PWV7
- PWVC
```


## Rekordbox My-Settings

Rekordbox stores the user settings in `*SETTING.DAT` files, which get exported to USB
Expand All @@ -126,37 +178,8 @@ sync = mysett.get("sync")
quant = mysett.get("quantize")
````


## Rekordbox 6 database

Rekordbox 6 now uses a SQLite database for storing the collection content.
Unfortunatly, the new `master.db` SQLite database is encrypted using
[SQLCipher][sqlcipher], which means it can't be used without the encryption key.
However, since your data is stored and used locally, the key must be present on the
machine running Rekordbox.

Pyrekordbox can unlock the new Rekordbox `master.db` SQLite database and provides
an easy interface for accessing the data stored in it:

````python
from pyrekordbox import Rekordbox6Database

db = Rekordbox6Database()

for content in db.get_content():
print(content.Title, content.Artist.Name)

playlist = db.get_playlist()[0]
for song in playlist.Songs:
content = song.Content
print(content.Title, content.Artist.Name)
````
Adding new rows to the tables of the database is not supported since it is not yet known
how Rekordbox generates the UUID/ID's. Using wrong values for new database entries
could corrupt the library. This feature will be added after some testing.
Changing existing entries like the title, artist or file path of a track in the database
should work as expected.


```{note}
The `DEVSETTING.DAT` file is still not supported
```

[sqlcipher]: https://www.zetetic.net/sqlcipher/open-source/
2 changes: 1 addition & 1 deletion docs/source/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ maxdepth: 3
---
configuration
db6
xml
anlz
mysetting
db6
````

0 comments on commit 3de0be8

Please sign in to comment.