spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
260 stars 57 forks source link

Export playlists to m3u using web interface #214

Closed Whisprin closed 3 years ago

Whisprin commented 3 years ago

This feature adds "export playlist" functionality to the web interface

codecov[bot] commented 3 years ago

Codecov Report

Merging #214 (08329fc) into master (be88f5f) will decrease coverage by 0.34%. The diff coverage is 21.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #214      +/-   ##
==========================================
- Coverage   88.56%   88.22%   -0.35%     
==========================================
  Files          35       35              
  Lines        3367     3380      +13     
==========================================
  Hits         2982     2982              
- Misses        385      398      +13     
Impacted Files Coverage Δ
supysonic/frontend/playlist.py 84.50% <21.42%> (-15.50%) :arrow_down:
supysonic/covers.py 80.39% <0.00%> (-3.93%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update be88f5f...08329fc. Read the comment docs.

spl0k commented 3 years ago

This generates a playlist to be used only on the hardware the Supysonic instance is running. Accessing Supysonic remotely would make these playlist files useless. One solution to make them work anywhere would be to generate the stream endpoint for each entry, but this poses several issues:

For these reasons, I'll reject this PR as I don't think we can easily generate playlist files that work "everywhere" without introducing a security flaw.

Whisprin commented 3 years ago

@spl0k I respect your decision to not upstream this feature. But isn't it still better than nothing? We can add more features in the future if desired.

The playlist is a a plain text file. As a user I can use search and replace to make the server paths match my local mount. Would you accept the PR if the search and replace would happen server side before exporting the playlist?

Another option is a playlist file with relative paths. But this works within one music search directory only.

As a user the playlists I create are of high importance to me. I'd like to have a way to store them offline - even if restoring them would require some effort.

If you'd like to discuss this further, I can hopen an issue here. Please let me know

spl0k commented 3 years ago

You're not just a simple user, you are a tech savvy user who knows what the m3u files are and how they are formatted. Well ok, maybe random people won't even know how to install or use Supysonic. But even then as a user if I'm presented with a feature I'm expecting it to work right away, without the need to apply some processing to its result to be fully usable. Still, the playlist will only be usable on the same system as Supysonic, so you're asking to add a feature to will work only for this very specific case. As the point of the Subsonic API is to be able access one's audiofiles from anywhere this feels confusing. After giving it some more thinking, I might actually accept this if we were to add some kind of disclaimer before exporting the playlist stating that it is meant to be used on the same system.

As for the relative paths, if you want to go that way maybe the easiest thing would be to strip the root folder's path.