Skip to content

Update m3u files #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Update m3u files #168

wants to merge 4 commits into from

Conversation

daladim
Copy link
Contributor

@daladim daladim commented Apr 27, 2025

Hello @timusus

This MR resolves #112 .

I have been using this code for a while now, and it suits my needs.

What it does
When using an S2 Media Store, when adding or removing or reordering songs to a playlist that initially came from an .m3u file on the disk, the underlying .m3u file gets updated on disk.
This way, the .m3u files are kept in sync with the Shuttle2 database.

What it doesn't do

  • Does not work with Android Media Store (I think). That does not sound like a problem, because this store does not allow importing m3u files in the first place
  • The following are (I think) hard to do because of limitations in the Android API:
    • It does not delete the .m3u file when a playlist is deleted (i.e. when deletePlaylist or deleteAll are called).
    • It does not rename .m3u files when a playlist is renamed (i.e. when renamePlaylist is called)
    • It does not create an .m3u file when a playlist is created. Which means (among other things) that it only tracks playlists that have been imported from the storage in the first place.

Notes

  • I'm not sure how to add unit/integration tests for this feature. This may be left for future work in an upcoming MR.
  • This is a behaviour I always want. Maybe some users would prefer not having the .m3u files synced? In this case, maybe the user-facing dialog when creating a S2 Media Store may contain an opt-out checkbox to disable this?

I'd be happy to have your thoughts on this!

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.

Ability to export playlists
1 participant