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

iiif thumbnail precaching #1697

Closed
wants to merge 4 commits into from
Closed

Conversation

Glignos
Copy link
Contributor

@Glignos Glignos commented Feb 6, 2019

No description provided.

@Glignos Glignos requested a review from slint February 6, 2019 13:28
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there amigos! 💃

tests/unit/conftest.py Outdated Show resolved Hide resolved
@@ -27,6 +27,7 @@
from __future__ import absolute_import, print_function

from datetime import datetime
import arrow
Copy link
Member

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 -*-
Copy link
Member

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/cache.py Outdated Show resolved Hide resolved
).source(include=['_files']))
records_files = q.scan()
for record_files in records_files:
for object_file in record_files.to_dict()['_files']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for object_file in record_files.to_dict()['_files']:
for object_file in record_files.to_dict().get('_files', []):

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']):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(object_file['type'] not in ['jpg', 'png', 'tif', 'tiff']):
if(object_file.get('type') not in ['jpg', 'png', 'tif', 'tiff']):

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
Copy link
Member

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

tests/unit/conftest.py Outdated Show resolved Hide resolved
zenodo/modules/thumbnails/cache.py Outdated Show resolved Hide resolved
@ChiaraBi ChiaraBi force-pushed the iiif_fixed_branch branch 10 times, most recently from 82b8b55 to dc395a8 Compare February 8, 2019 10:21
@ChiaraBi
Copy link
Contributor

ChiaraBi commented Feb 8, 2019

Tests are failing with Python 3.5 because here the key gets encoded. We should make a PR to flask-iiif to solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants