Remove unnecessary intification of timestamps.

I decided I want to have higher precision especially because
batch inserts were having several photos with the same
created timestamp making orderby >= dumb.
master
voussoir 2018-02-03 01:35:32 -08:00
parent b39f2e3f7b
commit f7dcb489c5
2 changed files with 4 additions and 4 deletions

View File

@ -613,7 +613,7 @@ class Photo(ObjectBase):
self.remove_tag(parent) self.remove_tag(parent)
self.photodb.log.debug('Applying tag {tag:s} to photo {pho:s}'.format(tag=tag, pho=self)) self.photodb.log.debug('Applying tag {tag:s} to photo {pho:s}'.format(tag=tag, pho=self))
now = int(helpers.now()) now = helpers.now()
cur = self.photodb.sql.cursor() cur = self.photodb.sql.cursor()
cur.execute('INSERT INTO photo_tag_rel VALUES(?, ?)', [self.id, tag.id]) cur.execute('INSERT INTO photo_tag_rel VALUES(?, ?)', [self.id, tag.id])
cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id]) cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id])
@ -925,7 +925,7 @@ class Photo(ObjectBase):
'DELETE FROM photo_tag_rel WHERE photoid == ? AND tagid == ?', 'DELETE FROM photo_tag_rel WHERE photoid == ? AND tagid == ?',
[self.id, tag.id] [self.id, tag.id]
) )
now = int(helpers.now()) now = helpers.now()
cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id]) cur.execute('UPDATE photos SET tagged_at = ? WHERE id == ?', [now, self.id])
if commit: if commit:
self.photodb.log.debug('Committing - remove photo tag') self.photodb.log.debug('Committing - remove photo tag')

View File

@ -272,7 +272,7 @@ class PDBPhotoMixin:
self.log.debug('New Photo: %s', filepath.absolute_path) self.log.debug('New Photo: %s', filepath.absolute_path)
author_id = self.get_user_id_or_none(author) author_id = self.get_user_id_or_none(author)
created = int(helpers.now()) created = helpers.now()
photo_id = self.generate_id('photos') photo_id = self.generate_id('photos')
data = { data = {
@ -965,7 +965,7 @@ class PDBUserMixin:
user_id = self.generate_user_id() user_id = self.generate_user_id()
hashed_password = bcrypt.hashpw(password, bcrypt.gensalt()) hashed_password = bcrypt.hashpw(password, bcrypt.gensalt())
created = int(helpers.now()) created = helpers.now()
data = { data = {
'id': user_id, 'id': user_id,