Beetstream icon indicating copy to clipboard operation
Beetstream copied to clipboard

SQL-based paging everywhere, and various other changes

Open FlorentLM opened this issue 9 months ago • 2 comments

As disussed in this issue, here's the PR that implements SQL-based paging.

However it also includes pretty heavy rewrites of the response-construction logic (and thus, of all endpoints functions), along with other minor additions / changes.

Full list (I think?):

  • Response construction is done via one unified dict-like structure and then converted into json or xml, which greatly simplifies adding new endpoints
  • All queries that can be paginated are paginated via SQL queries
  • Genres splitting when a song or album has a comma (or other delimiter)-separated list
  • Made the cover art logic more robust and faster, also fallsback to sending a cover from coverarchive.org when none is found locally
  • Added support for any m3u format including Beet's playlist and smartplaylist plugins' playlists (as well as Beetstream's own playlist_dir option of course)
  • Added support for native ffmpeg if the user donesn't have the python module installed
  • Added getAlbumInfo and getAlbumInfo2 endpoints
  • Various naming and stylistic changes to avoid shadowing built-ins (like id, etc) and for consistency

Tested with the following clients:

Gonna start implementing support for authentication in another branch and then will add the missing endpoints :)

Cheers!

FlorentLM avatar Mar 22 '25 20:03 FlorentLM

Just realised the XML version is completely borked haha Please ignore the PR for now!

FlorentLM avatar Mar 24 '25 23:03 FlorentLM

Oooookay I think we're good to go now - XML version seems to be fine in all the endpoints I could test (using Subtracks on Android).

I merged the dev branch into main so it also includes more stuff:

  • Almost all the fields possible in a Child response
  • Defining types to add things like play count, starred / liked, last played, to beet's database.
  • Avoiding setting lastModified to every time it's queried - hopefully speeding up some refreshes if nothing changed in the db
  • Various change of naming style

I realise this all became a lot of commits for yous to check though, sorry about that...

FlorentLM avatar Mar 25 '25 21:03 FlorentLM