feat: use file-based smart playlists
This PR replaces the smart playlists in the database with file-based ones. The format is DynoPL which I wrote.
!!! Warning!!!
On the boot, the smart playlists in the db are automatically converted to files.
You might want to comment the line await db.smartQueries.delete(smartQuery.id);
Please let me know what you think.
Wow! Man, this is great and seems so versatile. So much to dig into though, give me some time to gather my thoughts. On first glance:
- I like that the playlists are just stored as regular files next to the regular playlists, for the same reasons I moved the regular playlists to M3Us:
-
- peace of mind - I know that they are just files in a folder, rather than in some internal database. Gives me more sense of ownership.
-
- As a developer I don't have to worry about losing playlists if I wipe the database for testing purposes (which I do a lot!).
-
A couple of issues I noticed when playing around:
-
Ruletypes don't get recognized:Property 'is' does not exist on type 'Rule'. - Renaming the playlist doesn't seem to work
Ruletypes don't get recognized:Property 'is' does not exist on type 'Rule'.
Yes, I don't know why the union isn't correctly detected.
- Renaming the playlist doesn't seem to work
Yes, I wanted to have your feedback before moving forward. Also, I've just implemented what's the current smart playlist can do. I didn't added new features since I think a true sql db would be more easier to use. (Just generate a sql query from the rules, then simply execute it)