pyrekordbox.db6.aux_files#

exception pyrekordbox.db6.aux_files.XmlElementNotInitializedError(name)[source]#

Bases: Exception

Raised when an XML element is not initialized.

class pyrekordbox.db6.aux_files.MasterPlaylistXml(path=None, db_dir=None)[source]#

Bases: object

Rekordbox v6 masterPlaylists6.xml file handler.

Rekordbox stores some playlist information in the masterPlaylists6.xml file. Each playlist is represented by a <PLAYLIST> element, containing the following attributes: - Id: The playlist ID in hexadecimal format. - ParentId: The parent playlist ID in hexadecimal format. The root playlist has - Attributes: The type of playlist. 0 = normal, 1 = folder, 4 = smart playlist. - Timestamp: The last time the playlist was updated. - Lib_Type: ? (0 for palylists/folders) - CheckType: ? (always 0)

KEYS = ['Id', 'ParentId', 'Attributes', 'Timestamp', 'Lib_Type', 'CheckType']#
property version#

!! processed by numpydoc !!

property automatic_sync#

!! processed by numpydoc !!

property rekordbox_version#

!! processed by numpydoc !!

property modified#

!! processed by numpydoc !!

get_playlists()[source]#

Returns a list of the attributes of all playlist elements.

get(playlist_id)[source]#

Returns element attribs with the PlaylistID used in the master.db database.

Parameters:
playlist_idstr or int

The playlist ID used in the main master.db database. This id is converted to hexadecimal format before searching.

Returns:
playlistdict
add(playlist_id, parent_id, attribute, updated_at, lib_type=0, check_type=0)[source]#

Adds a new element with the PlaylistID used in the master.db database.

Parameters:
playlist_idstr or int

The playlist ID used in the main master.db database. This id is converted to hexadecimal format before searching.

parent_idstr or int, optional

The parent playlist ID used in the main master.db database. This id is converted to hexadecimal format.

attributeint, optional

The type of playlist. 0 = normal, 1 = folder, 4 = smart playlist.

updated_atdatetime, optional

The last time the playlist was updated.

lib_typeint, optional

The libarray type. It seems to be always 0 for playlists.

check_typeint, optional

The check type. It seems to be always 0.

Returns:
elementxml.Element

The newly created element.

remove(playlist_id)[source]#

Removes the element with the PlaylistID used in the master.db database.

Parameters:
playlist_idstr or int

The playlist ID used in the main master.db database. This id is converted to hexadecimal format before searching.

update(playlist_id, parent_id=None, attribute=None, updated_at=None, lib_type=None, check_type=None)[source]#

Updates the element with the PlaylistID used in the master.db database.

Parameters:
playlist_idstr or int

The playlist ID used in the main master.db database. This id is converted to hexadecimal format before searching.

parent_idstr or int, optional

The parent playlist ID used in the main master.db database. This id is converted to hexadecimal format.

attributeint, optional

The type of playlist. 0 = normal, 1 = folder, 4 = smart playlist.

updated_atdatetime, optional

The last time the playlist was updated.

lib_typeint, optional

The libarray type. It seems to be always 0 for playlists.

check_typeint, optional

The check type. It seems to be always 0.

to_string(indent=None)[source]#
save(path=None, indent=None)[source]#