Re: [Banshee-List] Help needed to find my way in the new codebase



2008/3/17 Bertrand Lorentz <bertrand lorentz gmail com>:
>  On Sun, 2008-03-16 at 23:56 -0500, Gabriel Burt wrote:
>  > 2008/3/16 Bertrand Lorentz <bertrand lorentz gmail com>:
>  > >  After some looking around in the codebase, I'm having difficulties to
>  > >  find the replacement for what was "Globals.Library". It was used for two
>  > >  things :
>  > >  - Load the bookmarks only after the Library has finished loading.
>  > >  - Fetch the TrackInfo corresponding to a track_id. Bookmarks only work
>  > >  for tracks that are in the database, so that would be now
>  > >  "DatabaseTrackInfo".
>  >
>  > You can access it via ServiceManager.SourceManager.Library.  This
>  > should definitely be part of the not-yet-created documentation for
>  > creating Banshee extensions.
>
>  Thanks for the tip.
>
>  I still haven't been able to find a way to retrieve the
>  DatabaseTrackInfo object corresponding to a TrackId (it was
>  Library.GetTrack() in the old codebase). It feels like I'm missing
>  something...
>
>  Do I need to query the database directly, or is there a way to do this
>  with TrackListDatabaseModel ?
>
>  Sorry for cluelessness...

No problem at all.  So, TrackListDatabaseModel is really tied to
CoreCache, the filtered/sorted temporary view of the songs in whatever
Source its tied to (Library, a playlist, etc).  Since you should be
able to bookmark anything (eg especially podcasts), which are in
various PrimarySources (or will be soon),  I think the best way to get
the TrackInfo object out is to do:
DatabaseTrackInfo.Provider.FetchSingle (int trackid);

Cheers,

Gabriel


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