Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add separate image similarity flask server #88

Merged
merged 6 commits into from
Mar 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix nextcloud scan photos, yapf api/models.py
  • Loading branch information
Hooram Nam committed Mar 27, 2019
commit febbba42644974df74d431c6ed1097ddb22ac811
8 changes: 5 additions & 3 deletions api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,10 @@ def _autotitle(self):
if (max(timestamps) - min(timestamps)).days >= 3:
when = '%d days' % ((max(timestamps) - min(timestamps)).days)

weekend = [5,6]
if max(timestamps).weekday() in weekend and min(timestamps).weekday() in weekend and not (max(timestamps).weekday() == min(timestamps).weekday()):
weekend = [5, 6]
if max(timestamps).weekday() in weekend and min(
timestamps).weekday() in weekend and not (
max(timestamps).weekday() == min(timestamps).weekday()):
when = "Weekend"

title = ' '.join([when, pep, loc]).strip()
Expand Down Expand Up @@ -854,7 +856,7 @@ class LongRunningJob(models.Model):
finished = models.BooleanField(default=False, blank=False, null=False)
failed = models.BooleanField(default=False, blank=False, null=False)
job_id = models.CharField(max_length=36, unique=True, db_index=True)
queued_at = models.DateTimeField(default=datetime.now,null=False)
queued_at = models.DateTimeField(default=datetime.now, null=False)
started_at = models.DateTimeField(null=True)
finished_at = models.DateTimeField(null=True)
result = JSONField(
Expand Down
2 changes: 1 addition & 1 deletion nextcloud/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get(self, request, format=None):
# long running jobs

class ScanPhotosView(APIView):
def get(self, requests, format=None):
def get(self, request, format=None):
try:
res = scan_photos.delay(request.user)
logger.info('queued job {}'.format(res.id))
Expand Down