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
iiif thumbnail precaching #1697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there amigos! 💃
zenodo/modules/records/tasks.py
Outdated
@@ -27,6 +27,7 @@ | |||
from __future__ import absolute_import, print_function | |||
|
|||
from datetime import datetime | |||
import arrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess something was moved from here, so these imports are unecessary.
@@ -0,0 +1,27 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better name for the sub-module would be zenodo.modules.iiif
(since we're adding IIIF functionality)
zenodo/modules/thumbnails/tasks.py
Outdated
).source(include=['_files'])) | ||
records_files = q.scan() | ||
for record_files in records_files: | ||
for object_file in record_files.to_dict()['_files']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for object_file in record_files.to_dict()['_files']: | |
for object_file in record_files.to_dict().get('_files', []): |
zenodo/modules/thumbnails/tasks.py
Outdated
records_files = q.scan() | ||
for record_files in records_files: | ||
for object_file in record_files.to_dict()['_files']: | ||
if(object_file['type'] not in ['jpg', 'png', 'tif', 'tiff']): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(object_file['type'] not in ['jpg', 'png', 'tif', 'tiff']): | |
if(object_file.get('type') not in ['jpg', 'png', 'tif', 'tiff']): |
zenodo/modules/thumbnails/tasks.py
Outdated
for object_file in record_files.to_dict()['_files']: | ||
if(object_file['type'] not in ['jpg', 'png', 'tif', 'tiff']): | ||
continue | ||
size = '250,' # flask_iiif doesn't support ! at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need !
anyways, the w,
is fine
836fada
to
17b07ee
Compare
82b8b55
to
dc395a8
Compare
Tests are failing with Python 3.5 because here the key gets encoded. We should make a PR to |
dc395a8
to
5556a37
Compare
5556a37
to
d359ea7
Compare
d359ea7
to
60d4c78
Compare
No description provided.