Fix media tab not loading Thumbnails for images on server only #13155
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello i've had this issue for a long time and wanted to fix it.
The problem i found was that the cache manager never requested the server for a thumbnail because the condition to do so was never true. This caused that all my remote photos thumbnails were the default thumbnail image.
From what i understand if there is not a preview but there is a remote id it should ask the server for a thumbnail.
This never happened because of an && instead of an ||.
I also had to set updateThumbnailNeeded to false when it finished otherwise it entered a loop because it kept passing the validation:
if (thumbnail == null || file.isUpdateThumbnailNeeded())
.Regarding test i didn't really understand where and how to test this functionality because, in case of an integration test, i need a server to call.
I would be more than happy to add a test if some kind soul could give me a little help xD <3