Re: [Banshee-List] banshee synchronization code (in-depth)



Hi Bob,

Bob Copeland wrote:
I may misremember something here so someone feel free to correct me,
but the last time I looked at the sync code, what it did was this:

1) Make a list of every track on the DAP (the dap plugin does this)
2) Add all the songs you want to save to the list, either the new ones
you just added or the whole library if you are syncing the whole
library
3) Add all the songs you want to remove to a different list
4) Save everything in the lists by calling back into the DAP plugin
(Synchronize() method)

Synchronize depends on the plugin, but generally it looks at any songs
in the remove queue, deletes them, then adds to the DAP all the tracks
in the track list that aren't already on the DAP.  So I guess this is
like a forward sync with deletes.  I'm not sure if any plugins copy
tracks from the DAP back into the banshee library.

Right, that would be a forward synchronization. So that's implemented in the banshee main code it depends on the DAP plugin. Makes sense, because every DAP likely has a completely different method of managing its tracks (i.e. filesystem, proprietary, sqlite, etc).

Just out of curiousity, does the existing code within the DAP plugin do a hash on each of the songs that it pulls from the device (or, equally, select all the hashes from an existing DB on the DAP)?

This could be quite a bit of work, but I don't mind. It will be a good project to learn a bit about C# and brush up my SQL too.

~/Chris



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]