intel / dleyna-control

dLeyna-control is a Digital Media Player written in python to demonstrate how to use the dleyna DMS APIs. It detects Digital Media Servers on the local area network and allows users to browse, search and play their contents.
https://01.org/dleyna/
GNU Lesser General Public License v2.1
8 stars 12 forks source link

[Model] Auto-load items also when max_items is not known #11

Closed jku closed 11 years ago

jku commented 11 years ago

This is my suggestion for dealing with servers that do not include "max_items" in search results. I was originally thinking of additional UI (e.g. "next or "previous" buttons) but it seems just loading more items when you scroll near the end works quite well with the asynchronous loading. This doesn't stop us adding buttons or otherwise informing the user but it already works as a basic solution.

Not that it's just one commit on top of the browse-branch.

Commit mostly removes special cases for the servers that do not support max_items:This means that scrolling close to the end of the list will make new items appear at the end of the list. This affects things like scrollbar handle size and location but it is no longer annoying as scrolling is still fairly smooth (as smooth as it can be when items are added into a TreeView, I believe).

Also added GenericModel.length_is_known() so we can still avoid unnecessary TreeView.get_visible_range() calls with servers that do announce max_items.