Skip to content

Commit

Permalink
Fixing lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
savvasdalkitsis committed Nov 27, 2024
1 parent 02a07be commit b35a7f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 1 addition & 3 deletions api/directory_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ def handle_new_image(user, path, job_id, photo=None):
photo._get_blurhash()
elapsed = (datetime.datetime.now() - start).total_seconds()
util.logger.info(
"job {}: get blurhash: {}, elapsed: {}".format(
job_id, path, elapsed
)
"job {}: get blurhash: {}, elapsed: {}".format(job_id, path, elapsed)
)
photo._recreate_search_captions()
elapsed = (datetime.datetime.now() - start).total_seconds()
Expand Down
12 changes: 7 additions & 5 deletions api/models/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from fractions import Fraction
from io import BytesIO

import blurhash
import numpy as np
import PIL
import requests
import blurhash
from django.contrib.postgres.fields import ArrayField
from django.core.files.base import ContentFile
from django.db import models
Expand Down Expand Up @@ -843,7 +843,9 @@ def _get_blurhash(self, palette_size=16):
if self.blurhash:
return
try:
hash = blurhash.encode(self.square_thumbnail_small.path, x_components=4, y_components=4)
hash = blurhash.encode(
self.square_thumbnail_small.path, x_components=4, y_components=4
)
self.blurhash = hash
self.save()
except Exception:
Expand Down Expand Up @@ -886,7 +888,7 @@ def _set_embedded_media(self, obj):
return obj.main_file.embedded_media

def __str__(self):
main_file_path = self.main_file.path if self.main_file is not None else "No main file"
return (
"{} - {} - {}".format(self.image_hash, self.owner, main_file_path)
main_file_path = (
self.main_file.path if self.main_file is not None else "No main file"
)
return "{} - {} - {}".format(self.image_hash, self.owner, main_file_path)

0 comments on commit b35a7f9

Please sign in to comment.