zotero / zotero-connectors

Chrome, Firefox, Edge, and Safari extensions for Zotero
https://www.zotero.org/download/connectors
Other
480 stars 119 forks source link

Show embedded/generic metadata at top of Select Items dialog for DOI translator if no close matches #392

Closed dstillman closed 10 months ago

dstillman commented 1 year ago

https://twitter.com/zotero/status/1546780072476033025

It's always been confusing that the DOI translator might not show anything for the page itself. It seems like we could help by showing EM/generic data at the top of the list if there's not a close match among the DOIs:

1) When select-items dialog is triggered for the DOI translator, run EM translation or, failing that, extract the webpage title.

2) Compare it (or some variations of it, before/after pipes and colons and things that might be in webpage titles) to all the resolved DOI titles.

3) If there are no close matches (normalized levenshtein, etc.), add an entry with the EM/webpage title to the top of the list, above the other DOIs, and trigger the appropriate save method based on what the user selects.

Main downside would be that the tooltip would show DOI, yet there might be an entry at the top of the list that definitely wasn't DOI-quality data.

dstillman commented 1 year ago

Continues to confuse: https://twitter.com/Karolis_Ram/status/1570337762426949632

dstillman commented 1 year ago

And from https://github.com/zotero/translators/issues/3031, I'd add that, if no valid DOIs are actually found, it should just save the current page with the best available option.

dstillman commented 1 year ago

https://forums.zotero.org/discussion/104777/can-t-save-page-yellow-folder-showing-saves-links-on-page-but-not-entire-page

adomasven commented 1 year ago

Having mostly implemented this, I've run into some stupid issues, making me think this really should have been done in the DOI translator itself.

Firstly, the DOI translator has the lowest priority among translators, so it's never offered when a better translator, even EM, is available. Secondly, adding an option in the select dialog to save with a different method really messes things up. Our save pipeline is not set up in any way to be saving with two different methods (or two translators), and if the top entry in the select dialog offers the current page (to be saved as webpage), and the rest of the options are DOI save, we need to perform a translator save and a webpage save at the same time. This messes with the current setup of save sessions and progress dialog, and requires a full restructuring of our item saving logic flow.

So what could possibly be a simple change is actually a complex change requiring changes in the connector and zotero connector server architecture, to handle a fringe edge-case. On the other hand our "save as webpage" option creates the most trivial item with only the title and url set, and as such, adding such an item in the DOI translator would be very simple. Moreover, the logic to check whether the DOI provided items match the current change is only a few dozens of lines of code, and could easily be added to the DOI translator.

I don't think it's smart to do this in the connector.

dstillman commented 1 year ago

OK, yeah, that makes more sense. And then we'll get this automatically in translation-server and on mobile.

And I guess we could still tell easily from the data that the top item was for the current page and not DOI-quality data, in case we wanted to indicate that to the user somehow.

dstillman commented 10 months ago

Superseded by zotero/translators#3126