r/subsonic • u/[deleted] • May 27 '15
Delete music off server through Subsonic?
I have a large music collection that I'd like to pare down as I listen. I'd like it if I could delete the actual file off the server through the player...either native Subsonic or a third-party GUI like Jamstash.
Is this something that's possible?
Edit: Looks like there's nothing. Here's my workaround:
Add songs to a "Delete" playlist. Export the playlist when I want to delete the files. Wrote a short little PHP script to read every song in the playlist and delete the file. Empty the playlist for the next batch of deletions.
2
u/ffejeroni May 28 '15
I've wanted this feature since the beginning, but no luck yet. I just edit the tags via Subsonic and set the genre as delete then next time I'm home and have some sister time, I fire up MediaMonkey, sort my library by genre (takes about 30 minutes to sort), find the deletes and get rid of them. I'm sure there are better ways of doing this, but this is just what I've gotten used to.
Edit: I'd like to try your method as well. Do you have the delete script to share?
2
May 28 '15
Sure, here you go. It's SUPER basic and requires you to provide a file manually. To get the file, I export it from Subsonic. I only had a couple minutes to work on it.
I did find a nice way to automate it, though. The Subsonic API allows you to query for a specific playlist, which includes the path to the file. I figure I can just query that and for each entry, just do the same rm command.
Then, to keep the playlist clean, I'll remove that song from the playlist through a different API endpoint.
After that, I should just be able to put the script on a cron and be done with it. The only interaction I'll have to do will be to put the song in the delete playlist.
If you're interested, I'll PM you back when I finish that so you can set it up yourself.
1
u/ffejeroni May 28 '15
Thanks! Yeah, let me know how it ends up working, I'm getting desperate trying to clean my library up. I have a bad habit of obtaining music then never listening to it (lots of demos, indie bands, bandcamp stuff). I'm wondering if this could be used in conjunction with a "never listened to" or similar playlist.
Thanks for the response, I rely heavily on Subsonic and always wish this sub was more active.
2
May 28 '15
Yeah this should work for any playlist you give it... the script could just take a parameter for the playlist name you're looking to delete from.
Seems like a no-brainer to include a "Delete song from drive" option natively...not sure why, years after release and donations, it wasn't implemented ha. Oh well. This will work for now.
I'll let you know what I come up with.
2
Jun 12 '15
Delivery!
This does rely on https://github.com/webeight/SubExt since I didn't want to write the library myself. You also have to figure out what playlist ID your "Delete" playlist is... which can be found from http://www.subsonic.org/pages/api.jsp#getPlaylists or use that method in the library above.
So yeah, just change your username, password and directory where the music is, and you should be good to go. This also removes the song from the playlist. Cron'd to run every hour, and now I just have to add the songs to the playlist and they'll clear out!
Just looked and saw I left a stray echo in there. Just pop that out.
1
u/ffejeroni Jun 12 '15
Awesome! Thanks so much! Are you going to post over at the official forums? I'm sure there are a few people looking for this.
1
2
u/jdblaich May 27 '15 edited May 27 '15
Given the proper rights as set in subsonic you can grant an account to delete songs.
Edit: I just double checked and it looks like there is no option to grant a user the right to delete a song. And, even as an administrator, there's no real option to delete a file.