lauantai 13. kesäkuuta 2009

Fooling around with streamripper

Lately I have been playing around with streamripper. Currently I am able to record a stream with instance of streamripper controlled by InternetRadio-extension in Banshee.

Now I'd like to get those ripped songs automatically imported into music library.
At first I thought I would just have to move those new files into a folder that is scanned by music library itself. Turns out this is a feature I thought banshee would have (actually I heard there is an extension to do this, but I rather write a new one since I don't want my extension to have dependencies to other extension in sake of complexity).

I started writing a scanner that checks for new mp3-files every n-seconds. Now I should figure out a good way to do the actual importing. I've spent much time looking into how this should be done. Good start was to check how banshee imports new files to media library and how drag and drop works. I started writing a new custom "source", but I am not too far with this one.

Now that I've been playing with this background thread I got an idea to create other background thread for refreshing fetched stations' status. It would check which genres have already been fetched (get a distinct list of genres found among already fetched stations). Get a fresh list of stations from shoutcast with corresponding genres. Remove deleted stations, add new one and refresh now playing -field.

I think I will write streamripper part first. Make a prototype probably on Wednesday. Start with "refresh-thread" unless I notice something that has higher priority.

Ei kommentteja:

Lähetä kommentti