Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update URLs for web links #561

Conversation

alixlahuec
Copy link
Owner

@alixlahuec alixlahuec commented Feb 10, 2024

Description

Update how web links are generated, since Zotero has changed their internals. From manual checks, URLs obtained through navigation look like:

  • For user libraries: https://www.zotero.org/:username/items/:itemKey/library
  • For group libraries: https://www.zotero.org/groups/:groupId/:groupName/items/:itemKey/library

Some other patterns also work:

  • For user libraries:
    • https://www.zotero.org/:username/items/:itemKey (aka without /library suffix)
  • For group libraries:
    • https://www.zotero.org/groups/:groupId/:groupName/items/:itemKey (aka without /library suffix)
    • https://www.zotero.org/groups/:groupId/items/:itemKey/library (aka without group name; it'll redirect to the equivalent with the group name, though)
    • https://www.zotero.org/groups/:groupId/items/:itemKey

This PR updates the user pattern so that links work again (= username instead of users/:userId), and updates the group pattern so that it matches the eventual URL (= groups/:groupId/:groupName instead of groups/:groupId) even though it's not functionally broken otherwise.

Fixes #496

Validation

✅ User library links are correct
✅ Group library links are correct

Copy link

linear bot commented Feb 10, 2024

@alixlahuec alixlahuec changed the title fix(links): update URLs of web links fix: update URLs for web links Feb 10, 2024
Copy link

codecov bot commented Feb 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3187f7f) 85.74% compared to head (c7ff319) 85.70%.

❗ Current head c7ff319 differs from pull request most recent head 3e6f9f5. Consider uploading reports for the commit 3e6f9f5 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #561      +/-   ##
==========================================
- Coverage   85.74%   85.70%   -0.03%     
==========================================
  Files         162      162              
  Lines        4998     5000       +2     
  Branches     1308     1310       +2     
==========================================
  Hits         4285     4285              
- Misses        711      713       +2     
  Partials        2        2              
Files Coverage Δ
src/utils.ts 92.29% <100.00%> (+0.04%) ⬆️

... and 1 file with indirect coverage changes

@alixlahuec alixlahuec marked this pull request as ready for review February 10, 2024 21:27
@alixlahuec alixlahuec merged commit 36a1b23 into main Feb 10, 2024
2 checks passed
@alixlahuec alixlahuec deleted the feature/rm-549-bug-zotero-web-library-item-urls-are-not-working-anymore branch February 10, 2024 21:55
@github-actions github-actions bot mentioned this pull request Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Zotero Web Library Item URLs are not working anymore
1 participant