Page 1 of 1

Playlist.Tracks.Count

Posted: Wed Oct 20, 2010 1:19 pm
by trixmoto
This method is pretty inefficient, especially if the playlist is a complex autoplaylist. Could we please have a "Playlist.TracksCount" method which just returned the count? This should be much more efficient as it doesn't need to return all the track data and build the SongList object.

Re: Playlist.Tracks.Count

Posted: Wed Oct 20, 2010 10:06 pm
by jiri
We don't have any internal mechanism of getting track count of a playlist before its content is fully read from DB. I.e. in order to provide what you ask for, we'd have to implement it only because of this feature - which I wouldn't like to do, unless there's a very good reason why is such a performance improvement needed.

Jiri

Re: Playlist.Tracks.Count

Posted: Thu Oct 21, 2010 4:38 am
by trixmoto
It would just make my "Custom Reports" script a bit quicker, that's all! :)

Re: Playlist.Tracks.Count

Posted: Sat Oct 23, 2010 2:55 am
by Bex
Trix,
For static playlists you could use SQL to retrieve the trackcount quicker. It won't work for autoplaylists though which probably is the biggest culprit here.

Jiri,
If http://www.ventismedia.com/mantis/view.php?id=6412 would be implemented, we could do the same for autoplaylists! Plus more cool things. :)

Re: Playlist.Tracks.Count

Posted: Sat Oct 23, 2010 6:48 am
by ZvezdanD
Bex wrote:Jiri,
If http://www.ventismedia.com/mantis/view.php?id=6412 would be implemented, we could do the same for autoplaylists! Plus more cool things. :)
One more vote for GetAutoplaylistQuery.

However, I have one additional request, pretty please. It would be nice (if it is possible) to have SetAutoplaylistQuery as well.

Re: Playlist.Tracks.Count

Posted: Sat Oct 23, 2010 6:56 am
by trixmoto
Yeah, it's definitely autoplaylists which pose the problem, more so than static playlists.