Skip to content

feat: use file-based smart playlists#138

Open
daiyam wants to merge 2 commits intobasharovV:mainfrom
daiyam:feat-dynopl
Open

feat: use file-based smart playlists#138
daiyam wants to merge 2 commits intobasharovV:mainfrom
daiyam:feat-dynopl

Conversation

@daiyam
Copy link
Contributor

@daiyam daiyam commented Feb 26, 2025

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.

@basharovV
Copy link
Owner

basharovV commented Mar 7, 2025

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:
      1. 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.
      1. 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:

  • Rule types don't get recognized: Property 'is' does not exist on type 'Rule'.
  • Renaming the playlist doesn't seem to work

@daiyam
Copy link
Contributor Author

daiyam commented Mar 7, 2025

  • Rule types 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants