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;
|
ALTER TABLE archive_file CHANGE srt srt LONGTEXT;
|
||||||
'''
|
'''
|
||||||
md5sum = UnicodeCol(length=128, alternateID=True)
|
md5sum = UnicodeCol(length=128, alternateID=True)
|
||||||
|
sha1sum = UnicodeCol(length=40)
|
||||||
oxdb = UnicodeCol(length=128)
|
oxdb = UnicodeCol(length=128)
|
||||||
path = UnicodeCol()
|
path = UnicodeCol()
|
||||||
date = DateTimeCol()
|
date = DateTimeCol()
|
||||||
|
|
@ -290,6 +291,9 @@ class ArchiveFile(SQLObject):
|
||||||
|
|
||||||
extracted = BoolCol(default = False)
|
extracted = BoolCol(default = False)
|
||||||
|
|
||||||
|
def genSHA1(self):
|
||||||
|
self.sha1sum = oxdb_import.oxdb_sha1sum(self.path)
|
||||||
|
|
||||||
def _get_part(self):
|
def _get_part(self):
|
||||||
part = 1
|
part = 1
|
||||||
parts = re.compile('Part (\d)').findall(self.path)
|
parts = re.compile('Part (\d)').findall(self.path)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import time
|
||||||
|
|
||||||
import simplejson
|
import simplejson
|
||||||
|
|
||||||
|
from oxlib.file import sha1sum as oxdb_sha1sum
|
||||||
|
|
||||||
class OXDb:
|
class OXDb:
|
||||||
def __init__(self, archive):
|
def __init__(self, archive):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue