Closed fabiankirstein closed 8 years ago
@IvenZ Can you please review and try this in detail?
works like a charm. two things:
That is strange. I will check tonight. It wasn't like this for me.
But great review process. :)
I fixed the obvious bugs. But the refresh time is strange. I could reproduce it. Takes about a second on my machine. If I call the /media/list/ route directly it takes the usual 20ms. I discovered it has something to do with the creation of the media object right before the AJAX call. Somehow this is slowing down the request. Can you please verify this for me? Just comment out lines 247 and 248 (https://github.com/socia-platform/htwplus/blob/media_upload/app/controllers/MediaController.java#L247) It will be very fast then. So one request influences the next one.... And I don't understand what you mean with an "empty list" appears.
Yes, you are right. I followed the code to this point (https://github.com/socia-platform/htwplus/blob/media_upload/app/managers/MediaManager.java#L147). Here it gets slow.
https://github.com/socia-platform/htwplus/blob/media_upload/app/controllers/MediaController.java#L253 Why do you cut off the file.id? I need it for markdown (drag&drop) link creation. Is there a better way?
empty list issue:
I deleted the id for testing. Sorry. I will fix it. I understand that this file operation is slow, but it shouldn't influence the next request. Maybe it's because the local development environment runs in one thread. We should deploy it when everything works and see how it behaves live. Otherwise we have to put the file operations into a separate thread.
:+1:
@IvenZ Can you check again and if okay deploy it?
jquery.js:1471 Uncaught Error: Syntax error, unrecognized expression: /media/200?action=download
on a single download (but it gets downloaded)
filesize within the table isn't rendered after uploading
Both fixed! The JavaScript error is also present in master.
:+1: will be deployed on sunday
The list refresh is much faster live. Can you verify this?
yep
The media list is now updated automatically when the upload queue is completed.