PDA

View Full Version : "Download to Library" plugin anyone?



pippin
2011-08-05, 02:21
Now that I'm listening to music from Stereogum (http://stereogum.com/) on my Squeezebox, which is really being made easy with iPeng's new browser (ok the advertising had to be; but it's only coming in the next release currently waiting in the App Store approval process; ETA is Monday), there's of course this coming up again:

http://bugs.slimdevices.com/show_bug.cgi?id=16511

These are MP3 files. They play fine, but it would be too cool if I could just download them to my library. Context menu from the current playlist would be the initial way to go.

Of course, when this works, I would also like a CLI command to start the download right from the menu where I can also play the track, but just saving if I like something would be a good start.

C'mon, this can't really be that hard....

erland
2011-08-05, 04:18
C'mon, this can't really be that hard....

Don't think it is hard as long as we are talking about individual mp3 files (or whatever file format the site is publishing).

Just to make sure I understand what you like to do:
1. iPeng will play the remote url in SBS
2. The user will select the track in current playlist, open context menu and select the "Download and add to library" item provided by the plugin
3. The plugin will in the background download the file and put it in the "Downloaded music folder" and make sure it's scanned into SBS library.

One question that comes to mind is where to store the downloaded file. Some people (like myself) try to keep the music folder read-only and other people tend to completely delete the cache now and then. Maybe the plugin should have a configuration where you can specify a "Downloaded music folder" ?

The next question is if we need to store the files in some kind of structure or if it's enough to just store them in all directly in the "Downloaded music folder" ?

And the third question is what SBS version it would have to be supported in, is it enough if 7.6 is supported or is it important that 7.5 and earlier also is supported. 7.6 and later with its new scanner API would be preferred if we are talking about supporting a "Downloaded music folder" which might be somewhere outside the main "Music Folder" configured in SBS. It's possible to support 7.5 also if needed but it will require some extra logic.

And the forth question, is if there is a way to detect if it's a streaming source or a file possible to download, so we can make sure to only show this new context menu on files that can actually be downloaded.

I wonder if it would be worth to make it also support some kind of temporary music folder as some people had a need for when the new schema was discussed ? Feels a bit related...
http://bugs.slimdevices.com/show_bug.cgi?id=2333

The only thing I'm not sure about is if the context menu of remote tracks can be enhanced by plugins, but if I remember correctly I think Michael already does this in his Biography plugin so I think it should work.

Finally, just because I'm answering doesn't mean I've decided to do this.

So, anyone else that would like to be the hero in the community by providing an excellent add-on like this ?

pippin
2011-08-05, 04:52
Just to make sure I understand what you like to do:
1. iPeng will play the remote url in SBS
2. The user will select the track in current playlist, open context menu and select the "Download and add to library" item provided by the plugin
3. The plugin will in the background download the file and put it in the "Downloaded music folder" and make sure it's scanned into SBS library.

Yes. Plus
4. iPeng has a "play URL" menu that comes up in various places. Would be nice to be able to send a "download to music library" command for that one, too.


One question that comes to mind is where to store the downloaded file. Some people (like myself) try to keep the music folder read-only and other people tend to completely delete the cache now and then. Maybe the plugin should have a configuration where you can specify a "Downloaded music folder" ?

Yes. That's what I would do.
I would have it point at say "[MUSICFOLDER]/DownloadedTracks" by default and make that configurable.


The next question is if we need to store the files in some kind of structure or if it's enough to just store them in all directly in the "Downloaded music folder" ?

If one is being nice... When it's in NowPlaying you often already know artist and album name so you could put it in "[MUSICFOLDER]/DownloadedTracks/[ARTIST]/[ALBUM]/[Filename]" or "[MUSICFOLDER]/DownloadedTracks/Unknown Artist/[ALBUM]/[Filename]" if you only know the Album or in "[MUSICFOLDER]/DownloadedTracks/[ARTIST]/[Filename]" is you only know the artist.


And the third question is what SBS version it would have to be supported in, is it enough if 7.6 is supported

Definitely. Don't bother about 7.5.x, 7.6 is not as bad as people are making it here.


And the forth question, is if there is a way to detect if it's a streaming source or a file possible to download, so we can make sure to only show this new context menu on files that can actually be downloaded.

Now THAT is a good one. I have no idea. Somethign called ".mp3" could be a streaming source as well, couldn't it?
The server HAS to know somewhere, doesn't it? I mean: loading a stream is something else than loading a file over http, isn't it?


I wonder if it would be worth to make it also support some kind of temporary music folder as some people had a need for when the new schema was discussed ? Feels a bit related...
http://bugs.slimdevices.com/show_bug.cgi?id=2333

Hm. A bit too complicated for the start if you ask me...

erland
2011-08-16, 21:49
Nobody interested in trying to implement this ?
Is pippin the only one who would like this kind of functionality ?