> Theoretically it would be possible to join with the url instead of
id,
> but as I remember I use id to improve performance. I think I joined
url
> initially when I wrote the plugin but don’t remember if I even
released
> that version. So I’m indeed relying on the track id being the same as
in
> the tracks table.

I believe performance indeed is why Andy introduced the urlmd5 column at
some point. Using that might be a good compromise.

> If it’s complicated to change it in the LMS core it might be possible
to
> handle it in the plugin if it’s possible to somehow retrieve the
> database track object through an extra call/query if the plugin get a
> remote track object from objectForUrl. However, since I’m not able to
do
> this myself it could maybe be a bit tricky for a new developer to
> implement such fix. This of course assumes there is a database track
> object available. Not sure in which situations objectForUrl would
return
> a remote track object ? 

Basically whenever there's one. Which would always be the case when
dealing with it while it's being played.

I was considering adding a parameter to objectForUrl for the very
purpose you suggest, but went with a less "intrusive" way which I
thought wouldn't require any change on your end. Alas, it wasn't good
enough. 

> I guess we are still talking about a track
> belonging to your favorites in the streaming service or is tracks you
> have played after searching/browsing the streaming service also added
to
> tracks table ? Only those you have integrated in you library should
be
> included in a dynamic playlist.

Yes, we're only talking about these. The others wouldn't be stored in
the database.

> I suspect the difference between my plugin and LMS core usage of
> objectForUrl is that LMS core mostly query the database using DBIx so
> the Slim::Schema objects are already there when objectForUrl is
called
> while my plugin query the database using raw SQL and only provides
the
> url so objectForUrl needs to query the database to fetch and create
the
> Slim::Schema objects.

objectForUrl is called from about three dozen places in LMS core...



Michael

"It doesn't work - what shall I do?" - "Please check your server.log
and/or scanner.log file!"
(LMS: Settings/Information)
------------------------------------------------------------------------
mherger's Profile: http://forums.slimdevices.com/member.php?userid=50
View this thread: http://forums.slimdevices.com/showthread.php?t=49483

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to