remove md5sum, remove md5->sha1 transition functions

This commit is contained in:
j 2008-10-13 15:19:49 +02:00
parent 643f88999b
commit d58c6f9928

View file

@ -139,7 +139,7 @@ class Archive(SQLObject):
for field in ('path', 'date'):
setattr(f, field, params[field])
else:
#just a new md5? happens for srt files quite often
#just a new hash? happens for srt files quite often
qq = ArchiveFile.select(AND(
ArchiveFile.q.archiveID == self.id,
ArchiveFile.q.path == params['path'].encode('utf-8'),
@ -257,7 +257,6 @@ class ArchiveFile(SQLObject):
ALTER TABLE archive_file CHANGE pixels pixels bigint;
ALTER TABLE archive_file CHANGE srt srt LONGTEXT;
'''
md5sum = UnicodeCol(length=128, alternateID=True)
sha1sum = UnicodeCol(length=40, alternateID=True)
oxdb = UnicodeCol(length=128)
path = UnicodeCol()
@ -426,25 +425,6 @@ class ArchiveFile(SQLObject):
if not f.path.endswith('.sub'):
if f.nameExtra == self.nameExtra or f.nameExtra == 'en':
self.subtitle_meta_id = f.id
def _get_mini_movie_file_old(self):
return join(cache.cache_root, 'mini', self.md5sum[:4], "%s.avi" % self.md5sum)
def _get_frameFolder_old(self):
f = join(cache.cache_root, 'frame', self.md5sum[:4], self.md5sum)
oxdb_makedir(f)
return f
def _get_stillFolder_old(self):
f = join(cache.cache_root, 'still', self.md5sum[:4], self.md5sum)
oxdb_makedir(f)
return f
def _get_timelineFile_old(self):
return join(cache.cache_root, 'timeline', self.md5sum[:4], "%s.png" % self.md5sum)
def _get_posterStillFile_old(self):
return join(cache.cache_root, 'posterStill', self.md5sum[:4], "%s.png" % self.md5sum)
def _get_cache_root(self):
return join(cache.cache_root, self.sha1sum[:2], self.sha1sum)
@ -468,22 +448,6 @@ class ArchiveFile(SQLObject):
oxdb_makedir(f)
return f
def moveCache(self):
make_dir = self.frameFolder
if os.path.exists(self.mini_movie_file_old):
for folder, folders, files in os.walk(self.frameFolder_old):
for f in files:
os.rename(join(self.frameFolder_old, f), join(self.frameFolder, f))
for folder, folders, files in os.walk(self.stillFolder_old):
for f in files:
os.rename(join(self.stillFolder_old, f), join(self.stillFolder, f))
if os.path.exists(self.mini_movie_file_old):
os.rename(self.mini_movie_file_old, self.mini_movie_file)
if os.path.exists(self.timelineFile_old):
os.rename(self.timelineFile_old, self.timelineFile)
if os.path.exists(self.posterStillFile_old):
os.rename(self.posterStillFile_old, self.posterStillFile)
def removeMiniMovie(self):
if exists(self.mini_movie_file):
os.remove(self.mini_movie_file)