epoupon / lms

Lightweight Music Server. Access your self-hosted music using a web interface.
http://lms-demo.poupon.dev
GNU General Public License v3.0
1.14k stars 62 forks source link

Import Playlists #391

Open jdewoody71 opened 11 months ago

jdewoody71 commented 11 months ago

Hello! I am trying LMS out and can't seem to find how to import my playlists. Thanks!

epoupon commented 11 months ago

Hello! For now you can't!

jdewoody71 commented 11 months ago

Thank you for the quick response. I must say, it's disappointing that this media server is missing one basic function that most other have.

epoupon commented 11 months ago

Yes indeed :(

TanqBQZ commented 2 months ago

@epoupon I'm looking forward to this aswell !

simonbun commented 1 week ago

@epoupon I spent all that time building test cases to see how LMS handled album attribution only to assume that external playlists would just work!

I've already spent a little time looking at how to export playlists and rated tracks from LMS, and I'm now wondering if I can create the playlists in lms.db directly (for the initial load). If it's safe to do so, how do I handle the lms.db-WAL journal, as when exporting I had to perform a full rescan for playlists and rated tracks to appear in lms.db, even shutting down the server didn't bring the changes across.

epoupon commented 1 week ago

Hello, what do you want to do exactly?

What I planned is to import playlist files that are within media libraries and automatically create/update corresponding public playlists within LMS.

simonbun commented 1 week ago

At a basic level all I want to be able to do is to import playlists into LMS and have the ability to export them too (in addition to ratings/favourites e.t.c., but I can script that aspect of things).

My current workflow in the UPnP world is for the server to index the local m3u8 playlists and present them to control points, within which I'll modify those playlists as well as create new ones. At some point I'll export the playlists from the control point (containing new and modified playlists that were originally indexed by the server), convert them to m3u8 and load them back into my media collection to be indexed by the server, after which I'll clear them from the control point. It's a long winded process but it's the only way to have shared playlists across devices.

I've yet to really test playlist functionality but hopefully I can simplfy that process somewhat :)

epoupon commented 6 days ago

To answer your original question, yes you can create yourself a playlist in the db. What you have to do is to add an entry in the tracklist table with type = 0, public = 0, and user_id = the id of your user. Then you have to create a record in the tracklist_entry table for each track you want to add in your playlist. It is safer to do this offline, but technically it could be done while LMS is running (as long as you don't do this while scanning for adding/removing tracks)

simonbun commented 5 days ago

I had a chance to look at it over the weekend and it works well.

In Symfonium you have to manually import each playlist separately, which is a bit frustrating, and during import you can choose to make the playlist readonly or have it sync with the server. If/when you decide to enhance LMS by importing playlists, would it be possible to set them as readonly, or are clients expecting to be able to update the server?

Whilst from an OpenSubsonic point of view it doesn't look like a playlist can have its own artwork, it would be nice for the web-gui (having same location and name as playlist).

epoupon commented 5 days ago

Yes, imported playlists will be read only/public, and synced with the playlist files. Users will be able to load the public playlists and re-save them as they want (but only as another private or public playlist)