xbmc/xbmc — pull request #1191 by dez-dk (2012-07-21 12:11:28+00:00)
Title: VideoInfoScanner slightly optimized

Using assumptions about the user-specified settings the VideoInfoScanner has been optimized in an attempt to reduce roundtrips when scanning a movie collection which is mounted from a network location.

The DoScan() method has been refactored to use a CFileItemPtr instead of just a string. This let's us grab a lot more fileinfo at once instead of doing individual stat() calls on every subdir and file.

If the user has chosen "Movies are in separate folders" we assume:
* They do not want to scan the dir itself as a movie (only subdirs). This saves a Stack() and GetPathHash() call on a potentially large dir.

If the user has also selected not to recurse the dir we assume:
* That it's okay to fasthash subdirs. Instead of grabbing the info about every file/dir in the subdir we use the date from the FileItem we've already grabbed to do fast hashing.