diff --git a/etiquette.py b/etiquette.py index 1bb3d6d..c04f4b5 100644 --- a/etiquette.py +++ b/etiquette.py @@ -227,7 +227,6 @@ def post_register(): response = flask.Response('redirect', status=302, headers={'Location': '/'}) return response - @site.route('/logout', methods=['GET', 'POST']) @session_manager.give_token def logout(): diff --git a/objects.py b/objects.py index 59a74a3..0f8ba26 100644 --- a/objects.py +++ b/objects.py @@ -413,7 +413,13 @@ class Photo(ObjectBase): timestamp = 0 else: timestamp = 2 - constants.ffmpeg.thumbnail(self.real_filepath, time=timestamp, quality=2, size=size, outfile=hopeful_filepath) + constants.ffmpeg.thumbnail( + self.real_filepath, + outfile=hopeful_filepath, + quality=2, + size=size, + time=timestamp, + ) except: traceback.print_exc() else: @@ -421,7 +427,10 @@ class Photo(ObjectBase): if return_filepath != self.thumbnail: - self.photodb.cur.execute('UPDATE photos SET thumbnail = ? WHERE id == ?', [return_filepath, self.id]) + self.photodb.cur.execute( + 'UPDATE photos SET thumbnail = ? WHERE id == ?', + [return_filepath, self.id] + ) self.thumbnail = return_filepath if commit: @@ -678,12 +687,18 @@ class Tag(ObjectBase, GroupableMixin): # Iterate over all photos with the old tag, and swap them to the new tag # if they don't already have it. - generator = helpers.select_generator(self.photodb.sql, 'SELECT * FROM photo_tag_rel WHERE tagid == ?', [self.id]) + generator = helpers.select_generator( + self.photodb.sql, + 'SELECT * FROM photo_tag_rel WHERE tagid == ?', + [self.id] + ) for relationship in generator: photoid = relationship[constants.SQL_PHOTOTAG['photoid']] - self.photodb.cur.execute('SELECT * FROM photo_tag_rel WHERE photoid == ? AND tagid == ?', [photoid, mastertag.id]) + query = 'SELECT * FROM photo_tag_rel WHERE photoid == ? AND tagid == ?' + self.photodb.cur.execute(query, [photoid, mastertag.id]) if self.photodb.cur.fetchone() is None: - self.photodb.cur.execute('INSERT INTO photo_tag_rel VALUES(?, ?)', [photoid, mastertag.id]) + query = 'INSERT INTO photo_tag_rel VALUES(?, ?)' + self.photodb.cur.execute(query, [photoid, mastertag.id]) # Then delete the relationships with the old tag self.delete() diff --git a/phototagger.py b/phototagger.py index dd3bdb1..ed2f287 100644 --- a/phototagger.py +++ b/phototagger.py @@ -684,11 +684,17 @@ class PDBPhotoMixin: #print('Failed filename') continue - if any(not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] > value for (key, value) in maximums.items()): + if any( + not fetch[constants.SQL_PHOTO[key]] or + fetch[constants.SQL_PHOTO[key]] > value for (key, value) in maximums.items() + ): #print('Failed maximums') continue - if any(not fetch[constants.SQL_PHOTO[key]] or fetch[constants.SQL_PHOTO[key]] < value for (key, value) in minimums.items()): + if any( + not fetch[constants.SQL_PHOTO[key]] or + fetch[constants.SQL_PHOTO[key]] < value for (key, value) in minimums.items() + ): #print('Failed minimums') continue