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

Allow users to create selections from Wikipedia books #645

Merged
merged 6 commits into from
Jul 21, 2023
Merged

Conversation

audiodude
Copy link
Member

Fixes #644.

Users can create selections based on a Wikipedia "book" url, such as https://en.wikipedia.org/wiki/User:Audiodude/Books/test. The Book Builder fetches the wikitext of the page that is saved by this tool and parses out the article names, then saves them in S3. A frontend is provided for creation of Book selections, which verifies that the URL is present, valid, and matches the project selected in the dropdown.

Book selections can be used to create ZIM files just like any other selection.

@audiodude audiodude requested a review from rgaudin July 16, 2023 18:11
@codecov
Copy link

codecov bot commented Jul 16, 2023

Codecov Report

Patch coverage: 91.45% and project coverage change: -0.08 ⚠️

Comparison is base (977b804) 96.42% compared to head (d1c34dc) 96.34%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #645      +/-   ##
==========================================
- Coverage   96.42%   96.34%   -0.08%     
==========================================
  Files          98      100       +2     
  Lines        7714     7831     +117     
==========================================
+ Hits         7438     7545     +107     
- Misses        276      286      +10     
Impacted Files Coverage Δ
wp1/selection/models/book.py 85.71% <85.71%> (ø)
wp1/selection/models/book_test.py 96.72% <96.72%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kelson42
Copy link
Collaborator

@audiodude Does it grab title and subtitle?

@audiodude
Copy link
Member Author

@audiodude Does it grab title and subtitle?

It does not. I didn't see that requirement in the bug. What would you expect to use this data for? Selections currently only store their article lists (in S3) and don't have fields for additional metadata. I assume you want to use title and subtitle for metadata in the ZIM?

@kelson42
Copy link
Collaborator

@audiodude yes yes yes

@audiodude
Copy link
Member Author

Okay I think we should create a separate bug to track that work, since it is substantially more complicated than what's in this PR and would bloat this one (which is, of course, already finished).

@audiodude
Copy link
Member Author

I'm thinking of something following from #640 as well, where we can surface more of the ZIM metadata on the ZIM page, under an optional expanding section, with some of it pre-populated based on the result of the selection materialization.

wp1/selection/models/book.py Show resolved Hide resolved
wp1/selection/models/book.py Show resolved Hide resolved
Base automatically changed from start-petscan to expired-zim July 20, 2023 03:12
@audiodude audiodude force-pushed the expired-zim branch 2 times, most recently from cdcb5ab to bb4e5d1 Compare July 20, 2023 03:26
Base automatically changed from expired-zim to main July 20, 2023 03:40
@audiodude audiodude merged commit dd77154 into main Jul 21, 2023
@audiodude audiodude deleted the book-selection branch July 21, 2023 02:22
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.

Save Wikipedia books (created with Book creator) in ZIM
3 participants