-
Notifications
You must be signed in to change notification settings - Fork 53
extend modal dialog for uploading from server #245
Conversation
* add options to `import_via_symlinks`, `skip_duplicates` and `resync_metadata` * checks added to avoid conflicts between `delete_originals` and `import_via_symlinks` (the former takes precedence) * `resync_metadata` only available if `skip_duplicates`
* passing `resync_metadata` setting to server was missing * prevent code smells by introducing selector constants * remove unused CSS specification
We usually don't care about const duplication. :) |
The latest commit on the front and back ends address code smells and should resolve the remaining issues (including some fixes). While doing more debugging and testing, the following issues came up that are indirectly related:
For now I just wanted to keep a record of those observations. |
Well, until your changes
Doesn't it simply delete the temporary file from the
Yeah, I have noticed it does that with
Yeah... I guess we should just reinitialize using
I see that
I hope I pointed you in the right directions, should you feel like doing something about them! 😃 |
Yes it's only part of The purpose of the
Sounds reasonable. I'll have a closer look.
I think it should be the latter. Currently
Thanks for the leads - that's very helpful. In particular, it might be nice to have the option to cancel the import in a controlled manner. I am thinking of ESC (and/or a cancel button) triggering a confirmation dialog to stop the import and redefine ESC to close the import dialog on completion. I'll look into this. |
@kamil4 I think I found the culprit. In my view this was not intentional but rather a bug that prevented entries with value |
Yes, I'll look into it...
I have no idea how the front end could notify the server to cancel an ongoing operation. It doesn't mean that it can't be done though 😃. We already do something similar in the opposite direction, in that the server provides updates on the progress of the ongoing import. We added those not just because it's nice for the user to know what's going on, but because without periodic traffic over the open socket, the web browser would close it after a timeout, so the final status of an import operation would never be received. So perhaps it is possible to do something like that in the other direction as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'm done here!
@evoludolab, could you check if it still works correctly for you?
I had to fix the skip_duplicate
logic on the server (user selection was being ignored if it was set to 1
in the settings). I also improved the reporting of duplicates so that it no longer generates a generic message.
Thanks @kamil4. I just did some quick checks and everything looks good. I like the improved reporting during import and your clean-up with I would still like to activate the ESC button to close the final import dialog (and possibly allow to cancel the import). Unfortunately, however, I am currently pretty busy with other things and it might be a while before I get around to look into this further. As a consequence it's probably best to postpone and open a separate PR once I get a chance to address those items. |
Yeah, the current PR is complete and should be merged as-is. If you get around to activating the Esc button, just submit a new PR. |
I get this when I try:
|
I'm unable to reproduce. Again, I suspect that your server and front end were out of sync. |
Nah most likely some other bug. Whatever I'm not using this functionality. :) |
* cleanly abort import process on server * ESC button cancels import during process and closes modal panel after import has finished * more robust implementation for scrolling rows to bottom in import panel (hardcoded row height removed)
Implementing the option to abort the import process on the server in a controlled manner was an interesting exercise. In the end persistence prevailed and the solution is pretty simple. The ESC button provides a shortcut to cancel the import and once the import has finished closes the modal dialog. Now the PR includes all features I had planned at this point. |
@evoludolab I did a minor tweak both on the front and back end of your pull request, please check if it still works. This simplified the code base slightly. :) |
Looks indeed cleaner but unfortunately does not work anymore - I'm working on it. Just a heads-up, I had renamed the route at the last moment and forgot to change it in |
Fixed. Session variables do not get automatically updated in a running session and need to be explicitly read again (once I learned about sessions this was the trickiest part to realize 😃). Thus, the call @ildyria Thanks for streamlining the cancel request on both ends and getting rid of those silly dummy parameters. I was sure there was a better way to communicate with the server - now I know how! |
Now I am done here 😉 |
* save button at bottom of full settings page closes settings, while leaving sidebar open. * save using Enter key stays on settings page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment about what looks like a merge error.
I need to try this out before a final approval but it won't be tonight (sorry, it's past midnight already...). I hope to be able to do it tomorrow.
Enable cancelation for local uploads as well Add visual feedback on cancelation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I made my changes (mainly adding the Cancel button to regular local uploads, because I liked it so much for the server imports 😃).
Now, can we please finally focus on getting this merged rather than keep piling on more tweaks and new features? Because, with my grupy-old-man hat firmly on, this PR is driving me crazy! I feel like I've reviewed it five times already, and today I honestly kept asking myself What? This part is still not merged?! At this point, I consider it virtually unreviewable, especially after the last round of formatting tweaks from prettier (I hate that thing!). This should've been like three separate PRs!
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
The modal dialog for uploading media from the server includes a checkbox for deleting originals while, other relevant settings remain hidden in the advanced settings.
This pull request adds support for enabling/disabling
import_via_symlinks
,skip_duplicates
andresync_metadata
while preventing invalid combinations (e.g.import_via_symlinks
anddelete_imported
both enabled). The settings are used as defaults, except forresync_metadata
which was only available through the CLIlychee:sync
command but makes sense to include here as well (at least provided thatskip_duplicates
is enabled).Localizations of the additional text on the modal panel missing (English only).
The corresponding changes to the back end to process the settings on the modal panel are in LycheeOrg/Lychee#894.