Empty Smart Playlists #110
-
Hello, Thanks so much for this project it is great! Thanks, Alexander |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi Alexander, Same for me, The DB does not contain the contents of Smart-Playlists. I am pretty sure these Playlists are filled at runtime, so the contents are by design not stored in the DB. This kind of makes sense, since Rekordbox would need to write to the DB every time tracks in the collection change. The rules are stored as a XML string, e.g.: <NODE Id="123456789" LogicalOperator="2" AutomaticUpdate="0">
<CONDITION PropertyName="genre" Operator="1" ValueUnit="" ValueLeft="Genre name" ValueRight=""/>
<CONDITION PropertyName="artist" Operator="1" ValueUnit="" ValueLeft="Artist name" ValueRight=""/>
</NODE> The
Each
Usually the value is only stored in Hope that helps! I will try to implement a handler for the Smart Playlists soon! |
Beta Was this translation helpful? Give feedback.
-
I added a handler for the smart playlists. You can parse the XML as follows: from pyrekordbox.db6 import Rekordbox6Database, SmartList
db = Rekordbox6Database()
pl = db.get_playlist(ID=<id of smart playlist>)
smartlist = SmartList()
smartlist.parse(pl.SmartList)
for cond in smartlist.conditions:
print(cond) You can create a SQLAlchemy filter clause for queries: from pyrekordbox.db6 import DjmdContent
filter_clause = smartlist.filter_clause()
for content in db.query(DjmdContent).filter(filter_clause):
print(content) You don't have to do the querying manually, I also implemented a new method to return the contents of a playlist directly, from pyrekordbox import Rekordbox6Database
db = Rekordbox6Database()
pl = db.get_playlist(ID=<id of smart playlist>)
for content in db.get_playlist_contents(pl):
print(content) |
Beta Was this translation helpful? Give feedback.
I added a handler for the smart playlists. You can parse the XML as follows:
You can create a SQLAlchemy filter clause for queries:
You don't have to do the querying manually, I also implemented a new method to return the contents of a playlist directly,
supporting both regular and smart playlists:
…