Re: idleStreams
Michael Herger <slim-b/[email protected]> Mon, 7 Nov 2022 21:39:31 +0100
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Message-ID | <[email protected]> |
> But there was something else: once the SQlite query returns the track
> urls, the plugin retrieves the tracks (track objects). And it used
> Slim::Schema->resultset('Track')->objectForUrl($url). I've changed that
> to Slim::Schema->resultset('Track')->single({ 'url' => $url }) and this
> really speeds things up (3-4 secs for getting 4000 tracks/track objects
> now).
Oh, if already you're looking up track by track, Then I'd look into the
suggestion about _not_ sorting the URL list, but fetching them by random
ID. This way you save the overhead of the random sorting completely.
> BTW if I want to sort an array of track objects by e.g.
> artist->album->disc no->track no., would I use this or is there a faster
> way?
I think that's pretty much it. Except that you shouldn't access
_column_data, but $a->disc (or $a->album->disc?) and $b->tracknum directly.
> About the slider: that was a misunderstanding, I think. I know and use
> sliderInput_min_max_incrementval - *in* the LMS *settings* context. I
> was just looking for a way to use it *outside* of the LMS settings, so I
> don't have to recreate it when it (css, js) already exists, if only in
> the settings.
The JavaScript to parse those classes is only in the Settings pages. If
you wanted to have sliders outside, you'd have to implement this yourself.