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

refactor invenio-files-rest storage factory #159

Open
krzysztof opened this issue Aug 4, 2017 · 0 comments
Open

refactor invenio-files-rest storage factory #159

krzysztof opened this issue Aug 4, 2017 · 0 comments

Comments

@krzysztof
Copy link
Member

Most of that code:

assert fileinstance
fileurl = None
size = fileinstance.size
modified = fileinstance.updated
if fileinstance.uri:
# Use already existing URL.
fileurl = fileinstance.uri
else:
assert default_location
# Generate a new URL.
fileurl = make_path(
default_location,
str(fileinstance.id),
'data',
current_app.config['FILES_REST_STORAGE_PATH_DIMENSIONS'],
current_app.config['FILES_REST_STORAGE_PATH_SPLIT_LENGTH'],
)

Should be factored-out of the storage factory, since it's specific to the way we write FileInstance objects to disk.

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

No branches or pull requests

2 participants