[refactor] Fewer calls to DB for filename checking listings.