Playlists get deleted if library path is changed and collection gets rescanned
Hello,
I use Nextcloud 13.0.2 with the Music app 0.6.1. If I change the folder of my collection and start a rescan of the library, all playlists are deleted as well. Is it possible to keep the playlists and just mark any non-existing tracks for example?
Yes, starting from v0.6.0 the playlists get deleted when the music library path is changed. In previous versions, the playlist names were preserved but the playlist contents were wiped clean, and I thought that this was not very useful; who cares about playlists with no tracks.
The problem here is that when the collection path is changed, all the track entities are deleted from the database. The playlists, on the other hand, are linked to those track entities and hence the list contents are lost.
This could maybe be solved by internally storing the playlists as lists of files instead of lists of tracks. This, however, would be a non-trivial change. On the other hand, implementing #627 would mostly solve also this playlist issue.
Well, thankfully there were only a handful of playlists and I don't have to change the path a lot (actually just changed it from a folder to / which should cover all places then) so it should not happen that often. Still, if somebody has a lot of playlists with lots of titles, then this is quite a dealbreaker because it might be a lot of work to recreate them.
Another solution could be the possibility to export/import playlists (maybe a new symbol next to each playlist), maybe in combination with an automatic export if the library gets rescanned and reimport. Then nothing would be lost from a user perspective.
I agree that #627 is the best way to improve the situation. Meanwhile, it might be good to have a warning message on the settings page to inform the user about the side effects of changing the library path.
The brand new v0.7.0 released yesterday contains the enhancement #627; there, previously scanned tracks are not removed from the library or any playlists if they are available also under the new path after music path change. Furthermore, there is an info text telling that any tracks not under the new path will be removed from any playlists.
I think that this issue is now sufficiently handled and can be closed.