marcoc1712 wrote: 
> 
> 5. My suggestion was here just becouse I think is the more flexible and
> less costing mods could be done in LMS to enable people use this great
> functionality without the needs of complex UI or plugins, since every
> logic will be defined and applied outside LMS.
> 
> The last is not opposed as any other development in LMS or in plugin,
> new or existings, who is going to use what is, as usual, a matter of
> personal preferences, needs and culture.
> 
> What I could not understand is in what is different using a query
> defined in LMS and applied in every scan from the same 'query' defined
> i.e. in Foobar and applied once to add the library to tags.
> 
> Wy it should take few minutes in LMS and days in Foobar? 
> 
> a. Foobar has much more capability than advanced query (more parameters,
> regular expresions,...), so using it you did even not have to ask
> Michael to do nothing on LMS (and accordingly wait for).
> 
> b. The execution time could maybe be longer, but with a 50K tracks
> library this has never been a big deal, then, considering you need to do
> it just once, while scanner will process query in LMS everytime, in long
> terms could easily result in a benefit.
> 
> What when your son will start to listen to something he call Rock, but
> nothing to do with you use to tag as Rock?
> 
> c. Result is exactly the same, library_track is populated by a value
> calculated at scan time based on some user logics and then used all over
> LMS. 
> 
> Difference is LMS in one case in not aware of what this logic is, and
> this to me is a good separation of concerns principle implementation.
> 
I believe you can do exactly this with the API Michael has created, he
created two ways to register a library:

Code:
--------------------
    
  Slim::Music::VirtualLibraries->registerLibrary( {
  id => 'demoLongTracks',
  name => 'Longish tracks only',
  # %s is being replaced with the library's internal ID
  sql => qq{
  INSERT OR IGNORE INTO library_track (library, track)
  SELECT '%s', tracks.id 
  FROM tracks 
  WHERE tracks.secs > 600
  }
  } );
  
--------------------

The above is based on an SQL statement, which is the solution you don't
like.


Code:
--------------------
    
  Slim::Music::VirtualLibraries->registerLibrary( {
  id => 'demoComplexLibrary',
  name => 'Library based on some complex processing',
  scannerCB => sub {
  my $id = shift;         # use this internal ID rather than yours!
  
  # do some serious processing here
  ...
  
  # don't forget to update the library_track table with ($id, 'track_id') 
tuples at some point!
  }
  
--------------------

In this second variant you can get the information from what ever place
you want, your callback will be called by the scanner and it's your
responsibility to fill library_track with suitable tracks for your
library. If you want pick them from foobar that's just an implementation
choice of your plugin.

If third party developers (such as you or me) would have been a bit
faster, Michael would probably have stayed away from the GUI parts
completely, but since I didn't have time and I didn't want to do
something completely free, and no other developer was interested at the
time, Michael correctly decided that it was a good idea to do some
simple integration with advanced search to make it possible for people
to use the functionality until third party developers had the time to
develop something better.

Finally I just want to give Michael credit again for the way he did this
implementation, starting with the API and thus offer possibility to
third party developers to extend it is the way forward in the future
since we don't know how long Logitech will let Michael continue to work
on LMS core software. This way we always have the option to extend the
functionality through third party plugins even if LMS core development
stops completely.



Erland Isaksson ('My homepage' (http://erland.isaksson.info))
LEAD PLATFORM DEVELOPER OF 'ICKSTREAM MUSIC PLATFORM'
(HTTP://WWW.ICKSTREAM.COM) -  A WORLD OF MUSIC AT YOUR FINGERTIPS

(Also developer of 'many plugins/applets (both free and commercial)'
(http://wiki.slimdevices.com/index.php/User:Erland). If you like to
encourage future presence on this forum and/or third party plugin/applet
development, 'consider purchasing some plugins'
(http://license.isaksson.info))
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=101701

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta

Reply via email to