Added local database support to vastly speed up rescanning.