interim solution to migrate to sha1
This commit is contained in:
parent
de91269926
commit
33d1cd3cd3
2 changed files with 7 additions and 2 deletions
|
@ -258,6 +258,7 @@ class ArchiveFile(SQLObject):
|
|||
ALTER TABLE archive_file CHANGE srt srt LONGTEXT;
|
||||
'''
|
||||
md5sum = UnicodeCol(length=128, alternateID=True)
|
||||
sha1sum = UnicodeCol(length=40)
|
||||
oxdb = UnicodeCol(length=128)
|
||||
path = UnicodeCol()
|
||||
date = DateTimeCol()
|
||||
|
@ -289,7 +290,10 @@ class ArchiveFile(SQLObject):
|
|||
broken = BoolCol(default = False)
|
||||
|
||||
extracted = BoolCol(default = False)
|
||||
|
||||
|
||||
def genSHA1(self):
|
||||
self.sha1sum = oxdb_import.oxdb_sha1sum(self.path)
|
||||
|
||||
def _get_part(self):
|
||||
part = 1
|
||||
parts = re.compile('Part (\d)').findall(self.path)
|
||||
|
|
|
@ -13,6 +13,7 @@ import time
|
|||
|
||||
import simplejson
|
||||
|
||||
from oxlib.file import sha1sum as oxdb_sha1sum
|
||||
|
||||
class OXDb:
|
||||
def __init__(self, archive):
|
||||
|
@ -34,7 +35,7 @@ class OXDb:
|
|||
|
||||
def removeFile(self, params):
|
||||
return self._remote_call('remove', params)['result']
|
||||
|
||||
|
||||
def oxdb_md5sum(fname):
|
||||
'''Returns an md5 hash for file'''
|
||||
md5sum = None
|
||||
|
|
Loading…
Reference in a new issue