Re: [Banshee-List] MetadataService and MetadataProviders



On Mon, Mar 8, 2010 at 6:44 AM, Fernando Casanova <fcasanova fluendo com> wrote:
> Hi,
>
> I was starting to look at the MetadataService code and I have a few questions.
>
> If I understand this code correctly the MetadataService input item is
> always a track.
> But there is no way for the MetadataService to do job filtering (ie.
> to only process the track in case the input track matches a set of
> conditions). This filtering is done downstream in the
> MetadataProviders.
>
> The problem I'm trying to solve here is the following:
> - I want to add specific MetadataProviders for videos
> - I wouldn't like other MetadataProviders to be called
> and
> - I don't want to touch any of the other MetadataProviders
>
> Here are my questions:
> Has someone started to think about a way to handle this kind of stuff?
> Did I understand things correctly? Am I missing some point here?

It sounds like this bit of Banshee's code could use some
rewrite/reorganization.  The MetadataProviders should probably be
extensions - like I recently did in Shuffler.cs for random-by modes.
The MetadataProviders could have a method taking the track and
returning some score ranking how good a job they think they could do
returning data for that track, and then the Service could iterate
through them in that order.  By default all the other Providers might
return 50 for a video file (on say a [0-100] scale where 0 means
"don't even call me"), and your new provider could return 10 or
something.  I like the idea of making the Providers extensions and
maybe moving them out into src/Extensions, but that's only slightly
related to the issues you're talking about.

That's just one idea; feel free to work on this, changing anything you
need for it to be flexible enough to suit your needs.  The next step
is probably to open a bug about this, where we can further discuss it
and discuss any patches you come up with.

Thanks!

Gabriel


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