second go at fixing filename storage

This commit is contained in:
Steffen Schaumburg 2011-04-10 18:12:40 +02:00
parent 3160496cc1
commit d92c0fb27c

View File

@ -175,7 +175,11 @@ class Importer:
def addFileToList(self, file, site, filter):
now = datetime.datetime.utcnow()
file = os.path.splitext(os.path.basename(file))[0]
id = self.database.storeFile([unicode(file, "utf8", "replace"), site, now, now, 0, 0, 0, 0, 0, 0, False])
try:
file = unicode(file, "utf8", "replace")
except TypeError:
pass
id = self.database.storeFile([file, site, now, now, 0, 0, 0, 0, 0, 0, False])
self.database.commit()
return [site] + [filter] + [id]