neodb-social / neodb

🧩 NeoDB is a self-hosted server tracking what you read/watch/listen/play, powering a global distributed community federating via ActivityPub.
https://neodb.net
GNU Affero General Public License v3.0
470 stars 32 forks source link

Support adding Editions to Works as required_resources #728

Closed pmakholm closed 3 months ago

pmakholm commented 4 months ago

When scraping a work for a site, I would like to add (selected) editions.

I assumed that I could just return editions in pd.metadata["required_resources"]. This works correctly when I add a work when scraping editions.

Looking at the code this is due to a missing Work.update_linked_items_from_external_resource() method. This commits naively copies the implementation from Edition.update_linked_items_from_external_resource().

alphatownsman commented 3 months ago

Thanks, merged this. However, I suggest putting edition info in related_resources rather than required_resources in your work.scrape() code