Closed Kamuso closed 4 years ago
The request for add/remove tags has a return status of 200
I don't remember testing these. Will dig deeper and see, if it is my fault later this evening.
set name gives a 405
Try /api/images/:id/name
- without the trailing slash.
Yup, tag adding is broken somehow. This will take more time to fix.
Try /api/images/:id/name - without the trailing slash.
This made the request work, but the name had a bunch of extra data in it so I've got to fix that.
Yup, tag adding is broken somehow. This will take more time to fix.
r.Form.Get("tags") gives a blank string. I'll fix this at the same time as setting the name.
Okay, everything works as intended now, need to validate input, add fetchtags, and add upload page.
r.Form.Get("tags")
Odd, because that is not the bug I was seeing in the debugger. It went down to db.AddTagsTX() just fine and then something made it not write to the DB. Also, it might be because you are using multipart POST requests there (FormData API). I produced my bug with a PATCH to http://localhost:8010/api/images/e9336dc8634de6ef577232959e8c526dc7434e50/tags/?tags=sakura_kyouko
style URL. Notice the query string.
The tag issue is caused by #54 so just assume it works and I will fix it myself later on.
I think this will do for now. I wasn't sure how to make dropping images resolve to the import page, so I left that out. Upload progress is shown in the terminal, not the browser, but it seems good enough for now.
Okay. So now we have 2 conflicting ways to upload files in the web UI. Personally I like having a separate upload page like you built more, but automatically navigating to it on image drag&drop would be nice too. Perhaps that can be done by issuing a HTTP redirect to the upload page after all images are uploaded, but not thumbnailed. But that would also mena we would need to persist uploaded resources cross-request. Using the History API might be better then. Thoughts on this?
Upload progress is shown in the terminal, not the browser, but it seems good enough for now.
You can use Transfer-Encoding: chunked
and stream upload progress and any errors to the client on each tick. WIll require calling .Flush()
on the http.ResponseWriter
after each tick to prevent buffering. That can be used to display a progress bar.
Overall - great work. I'll get back to hydron once I'm more or less done with captchouli meguca integration.
Merry Christmas, have an update.
Mostly fixing some oversights in the import page.
2 conflicting ways to upload files in the web UI
I think it would be simplest to remove drag and drop uploads from the browser page and just have it in the imports page. There is a demo of that in this update, so depends how you feel about that.
You can use
Transfer-Encoding: chunked
and stream upload progress and any errors to the client on each tick.
I experimented with this but couldn't manage to get it to work. I tried a timed for loop to send some data in batches but it was all sent all together at the end. I don't think I'll be able to get that working on my own.
I think it would be simplest to remove drag and drop uploads from the browser page and just have it in the imports page. There is a demo of that in this update, so depends how you feel about that.
Drag and drop should ideally forward all your dropped files to the upload progress page. The way it is implemented now breaks navigation somewhat.
I experimented with this but couldn't manage to get it to work. I tried a timed for loop to send some data in batches but it was all sent all together at the end. I don't think I'll be able to get that working on my own.
Server Sent Events and some JS listening on the frontend? That way you can also reuse the current code that displays imports as they are completed. https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events https://github.com/alexandrevicenzi/go-sse
The way it is implemented now breaks navigation somewhat.
Right, but removing drag&drop from the search page would fix this. Would you accept that instead of redirecting? It would be much simpler.
Server Sent Events and some JS listening on the frontend?
Turns out SSE isn't necessary, the server code that I had before was correct, the JS wasn't. It now works properly using a ReadableStream
.
Right, but removing drag&drop from the search page would fix this. Would you accept that instead of redirecting? It would be much simpler.
I can write the redirect part, once we have a complete upload page.
I'm all done here, then.
Okay. I'll take a look at this next weekend.
On Sun, 24 Mar 2019 at 01:18, Kamuso notifications@github.com wrote:
I'm all done here, then.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakape/hydron/pull/51#issuecomment-475913059, or mute the thread https://github.com/notifications/unsubscribe-auth/AHfPsANRDyLUo9j7CFK8VtComUWb_do6ks5vZrZUgaJpZM4XFTru .
Okay, good work. I merged this into dev/options
. Once I add my own changes pertaining to drag&drop, I'll merge this into master.
Added the drag&drop behaviour you wanted. Also did some general clean up, like refactoring the indentation hell in import.js. Would have pushed to the new pr you made, but I didn't accept the collaboration invite before it expired. tehe pero
This has been a very long week.
On Tue, 28 Jul 2020, 13:30 Kamuso, notifications@github.com wrote:
Added the drag&drop behaviour you wanted. Also did some general clean up, like refactoring the indentation hell in import.js. Would have pushed to the new pr you made, but I didn't accept the collaboration invite before it expired. tehe pero
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakape/hydron/pull/51#issuecomment-664962819, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB347MFJ7ARDP2UHZFI6NGLR52SERANCNFSM4FYVHLXA .
sugoi
In main.js, the option to delete files works, but add/remove tags and set name don't. The request for add/remove tags has a return status of 200 but doesn't seem to do anything, set name gives a 405. I don't know what I'm doing wrong there. I also need to make the upload page and the fetch tags option before this is finished.