pragha-music-player / pragha

Pragha is a Lightweight Music Player for GNU/Linux.
GNU General Public License v3.0
173 stars 35 forks source link

Playlists are not handled correctly #133

Open triorr opened 6 years ago

triorr commented 6 years ago

Playlists are not handled correctly if you remove folders from library . To replicate this just create a playlist (select some files and do Save selection>new playlist) and remove the folder of the tracks folder from library . Now if you try to play that playlist nothing happen . Even if you try and add that folder back nothing happen .

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/56748842-playlists-are-not-handled-correctly?utm_campaign=plugin&utm_content=tracker%2F352350&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F352350&utm_medium=issues&utm_source=github).
triorr commented 6 years ago

I guess it's because of this sql = "DELETE FROM PLAYLIST_TRACKS WHERE file NOT IN (SELECT name FROM LOCATION)"; in the function pragha_provider_remove. Do we have to clean the PLAYLIST_TRACKS table after removing a library folder ? why ?

matiasdelellis commented 6 years ago

Hi @triorr Is it not logical that when a collection is deleted, these files in any playlist are discarded?

matiasdelellis commented 6 years ago

Hi @triorr In last commit fix a detail that is not exactly what you expect. Previously, when a provider was removed, it erased all song entries that where not in any other provider... which was incorrect.. :disappointed: As you think, the playlist may contain songs that are not in the database.. :wink: But if you intentionally eliminate a provider, it means that you will not use it, or you will not have more access to it. Therefore everything related to it must be eliminated.. :disappointed:

Which is how it behaves now..

triorr commented 6 years ago

Hello! Matias Thanks for your response and work, I relay appreciate your it . Practically your commit , solved the problem of having to delete empty playlists manually , but I have some concerns. You removed the possibility to add m3u file to playlists. I was hoping we could separate the playlists from providers so we can have better support for m3u files. Playlists have superposition as a feature that should be taken in account.

Here is my suggestion the PROVIDER table control the the TRACK table, the PLAYLIST table control the PLAYLIST_TRACKS table. And we could have some code to do some cooperation between TRACK and PLAYLIST_TRACKS for tracks info if it exists.

Forgive my noobiness :smile: Thanks.