diff --git a/oxdbarchive/model.py b/oxdbarchive/model.py index bb03a30..1c47252 100644 --- a/oxdbarchive/model.py +++ b/oxdbarchive/model.py @@ -469,13 +469,14 @@ class ArchiveFile(SQLObject): return f def moveCache(self): - for f in os.walk(self.frameFolder_old): - os.rename(join(self.frameFolder_old, f), join(self.frameFolder, f) - for f in os.walk(self.sillFolder_old): - os.rename(join(self.sillFolder_old, f), join(self.sillFolder, f) - os.rename(self.mini_movie_file_old, self.mini_movie_file) - os.rename(self.timelineFile_old, self.timelineFile) - os.rename(self.posterStillFile_old, self.posterStillFile) + if os.path.exists(self.mini_movie_file_old): + for f in os.walk(self.frameFolder_old): + os.rename(join(self.frameFolder_old, f), join(self.frameFolder, f) + for f in os.walk(self.sillFolder_old): + os.rename(join(self.sillFolder_old, f), join(self.sillFolder, f) + os.rename(self.mini_movie_file_old, self.mini_movie_file) + os.rename(self.timelineFile_old, self.timelineFile) + os.rename(self.posterStillFile_old, self.posterStillFile) def removeMiniMovie(self): if exists(self.mini_movie_file):