Fix #2091152 [Enhancement Request: Resolve doi.org links when pasting identifiers](https://bugs.launchpad.net/calibre/+bug/2091152)

This commit is contained in:
Kovid Goyal 2024-12-06 16:20:12 +05:30
parent 8c02414d84
commit 6e13089def
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1808,6 +1808,18 @@ class IdentifiersEdit(QLineEdit, ToMetadataMixin, LineEditIndicators):
return True
except Exception:
pass
for (key, prefix) in (
('doi', 'https://dx.doi.org/'),
('doi', 'https://doi.org/'),
('arxiv', 'https://arxiv.org/abs/'),
('oclc', 'https://www.worldcat.org/oclc/'),
('issn', 'https://www.worldcat.org/issn/'),
):
if text.startswith(prefix):
vals = self.current_val
vals[key] = text[len(prefix):].strip()
self.current_val = vals
return True
return False
# }}}