Make sure to make release download id lowercase
This commit is contained in:
@@ -50,15 +50,15 @@ class ReleaseIDIndex(HashIndex):
|
|||||||
|
|
||||||
|
|
||||||
class ReleaseDownloadIndex(HashIndex):
|
class ReleaseDownloadIndex(HashIndex):
|
||||||
_version = 1
|
_version = 2
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
kwargs['key_format'] = '32s'
|
kwargs['key_format'] = '32s'
|
||||||
super(ReleaseDownloadIndex, self).__init__(*args, **kwargs)
|
super(ReleaseDownloadIndex, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
def make_key(self, key):
|
def make_key(self, key):
|
||||||
return md5(key).hexdigest()
|
return md5(key.lower()).hexdigest()
|
||||||
|
|
||||||
def make_key_value(self, data):
|
def make_key_value(self, data):
|
||||||
if data.get('_t') == 'release' and data.get('download_info') and data['download_info']['id'] and data['download_info']['downloader']:
|
if data.get('_t') == 'release' and data.get('download_info') and data['download_info']['id'] and data['download_info']['downloader']:
|
||||||
return md5('%s-%s' % (data['download_info']['downloader'], data['download_info']['id'])).hexdigest(), None
|
return md5(('%s-%s' % (data['download_info']['downloader'], data['download_info']['id'])).lower()).hexdigest(), None
|
||||||
|
|||||||
Reference in New Issue
Block a user