How does Sonarr determine the quality of a file?

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