Convert preferred bitrate to vbr preset for what.cd searching

This commit is contained in:
rembo10
2015-06-08 21:56:10 -07:00
parent cd08b72df7
commit 1204afadbb

View File

@@ -1280,6 +1280,12 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, choose
search_formats = [None] # should return all
bitrate = headphones.CONFIG.PREFERRED_BITRATE
if bitrate:
if 225 <= int(bitrate) < 256:
bitrate = 'V0'
elif 200 <= int(bitrate) < 225:
bitrate = 'V1'
elif 175 <= int(bitrate) < 200:
bitrate = 'V2'
for encoding_string in gazelleencoding.ALL_ENCODINGS:
if re.search(bitrate, encoding_string, flags=re.I):
bitrate_string = encoding_string