Speed up MovieSelection directory counts

Issue #736 resolved
prl created an issue

When directory counts are enabled in MovieSelection, loading the directory list MovieSelection.load()is considerably slower on directories with large numbers of recordings and files in the subdirectories than when counts are disabled.

This is partly because when serviceHandler.info(serviceref) is called on a recording, the recording’s .ts.meta file is read. Provided the user is not filtering by tags, there is no need to call info() on files/recordings.

The existing test in name[:2] == "._" (i.e. on serviceHandler.info(serviceref).getName(serviceref)) can be replaced by a similar test on serviceref.getPath() and avoid the need for info() to be called on every file being counted.

The change is actually more correct, because the test should be on the file name, not on the logical (e.g. recording) name of the serviceref, because the test is avoiding filesystem name clutter in MacOS (on filesystems that don’t support file attributes).

Comments (1)

  1. Log in to comment