FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Deleting Playlist Entries via sql
- This topic has 2 replies, 2 voices, and was last updated 15 years, 8 months ago by RigasW.
-
AuthorPosts
-
29/07/2008 at 9:26 AM #2582RigasWParticipant
Hi,
I started using version 1586 on a slug with sqlite3 as database. I switched to that version, because it can be used together with the Java Standalone Client, that you can use to build playlists.
Unfortunately, the Java Client cannot remove songs from a playlist. As you create playlists with drag&drop, it is easy to add a song to the wrong playlist … (i am sure that the remove-feature will come some day…)
So I created the following SQL statement, that you have to run in sqlite3:
delete from playlistitems where playlistitems.id IN (select playlistitems.id from songs, playlistitems,playlists where songs.id=songid and playlists.id = playlistitems.playlistid AND songs.title like "%Summer%" AND playlists.title like "%oboe%");
In this example the Sql statement removes all entries containing “..Summer..” from a playlist with the name ” .. oboe ..”. In all other playlists the song with “summer …” is not removed.
I am not very familiar with SQL … may be one of the SQL pros here can have a look and do some adjustment, if necessary …
Rigas
01/08/2008 at 11:44 AM #17545EVILRipperParticipantAs you found yourself, Summer is deleted, but summer isn’t.
Case sensitivity is the problem.
A simple and common solution is casting both values to lowercase, then compare them:
… AND LOWER(songs.title) like “%summer%” AND …01/08/2008 at 9:25 PM #17546RigasWParticipantHi,
I did some tests with SELECT statements like
select * from songs where Title like "%summer%";
It was not case sensitive … so the statement above found songs with “Summer ” in it, too.
Rigas
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.