Skip to content

Fix: Gallery Thumbnails Failing to Re-Assign #93

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

Merged

Conversation

jabbate19
Copy link
Contributor

@jabbate19 jabbate19 commented Mar 29, 2022

So when a file that was the thumbnail of a directory is deleted, the directory doesn't update and causes a 404 when Gallery reaches out to S3/Local Storage to get it again. This makes it detect a non-ok status code and reset the thumbnail for that directory.

Fixes #65
Fixes #67
Fixes #80

@mxmeinhold
Copy link
Contributor

Does this really fix 67?

@jabbate19
Copy link
Contributor Author

There's no need for a UI now. It is automatically checking for broken and knows how to fix itself

@mxmeinhold
Copy link
Contributor

Does it update the thumbnail when files get moved? Or only when the thumbnail results in a 404? If it doesn't, then this doesn't resolve 67 nor 65

@jabbate19
Copy link
Contributor Author

I moved a file in my dev instance and it updated the thumbnail

@jabbate19 jabbate19 requested a review from mxmeinhold March 31, 2022 05:29
Copy link
Contributor

@mxmeinhold mxmeinhold left a comment

Choose a reason for hiding this comment

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

One concern, otherwise LGTM

link = "http://" + app.config["SERVER_NAME"] + link
req = requests.get(link)
while req.status_code != requests.codes.ok:
dir_model.thumbnail_uuid = refresh_directory_thumbnail(dir_model)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this default to the "no thumbnail" photo if it fails to generate one? Want to be sure this can't loop infinitely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

@mxmeinhold mxmeinhold merged commit 4ab26f9 into ComputerScienceHouse:develop May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants