Just replying for those looking for the same information… Sonarr is indeed using the file name to determine quality: