migrate controller to sha1
This commit is contained in:
parent
22288c745f
commit
c2c6ca2bd0
1 changed files with 7 additions and 7 deletions
|
@ -10,9 +10,9 @@ import backup
|
|||
# log = logging.getLogger("oxdbarchive.controllers")
|
||||
|
||||
'''
|
||||
/md5/frame/position.jpg
|
||||
/md5/clip/position.jpg
|
||||
/md5/metadata
|
||||
/sha1/frame/position.jpg
|
||||
/sha1/clip/position.jpg
|
||||
/sha1/metadata
|
||||
'''
|
||||
|
||||
def httpExpires(sec):
|
||||
|
@ -21,14 +21,14 @@ def httpExpires(sec):
|
|||
|
||||
class Root(controllers.RootController):
|
||||
@expose()
|
||||
def default(self, md5Hash = None, action = None, position = None):
|
||||
if not md5Hash:
|
||||
def default(self, sha1Hash = None, action = None, position = None):
|
||||
if not sha1Hash:
|
||||
return dict()
|
||||
try:
|
||||
f = ArchiveFile.byMd5sum(md5Hash)
|
||||
f = ArchiveFile.bySha1sum(sha1Hash)
|
||||
except:
|
||||
#return dict()
|
||||
f = backup.Backup(md5Hash)
|
||||
f = backup.Backup(sha1Hash)
|
||||
if not f.exists():
|
||||
return dict()
|
||||
if action == 'metadata':
|
||||
|
|
Loading…
Reference in a new issue