ShelfPlayer icon indicating copy to clipboard operation
ShelfPlayer copied to clipboard

[Improvement] Respect "Can Download" user setting

Open PulsarFTW opened this issue 10 months ago • 0 comments

Audiobookshelf has "can download" as a user option which restricts downloading of books in the official app and via the WebUI. This setting is not respected within ShelfPlayer and I am unsure if this is a conscious choice or due to limited API documentation.

After discussion on discord it was confirmed that there are two endpoints available: /some-suff-something/file/<id> and /some-suff-something/file/<id>/download.

Both of these API endpoints are essentially the same, however the one that ends with /download fails when the download permission is disabled allowing for easy implementation in the application. Another benefit of the /download endpoint is that logs will correctly be recorded with [LibraryItemController] User "USER" requested download for item "THE BOOK TITLE" at "/PATH/TO/AUDIOBOOK/LOCATION". There are currently no logs generated when I start a download within ShelfPlayer.

Image User has download permission disabled.

Image Download was allowed and is in progress with ShelfPlayer.

PulsarFTW avatar Apr 16 '25 17:04 PulsarFTW