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

RSS for shelves #3013

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Conversation

mattkatz
Copy link

@mattkatz mattkatz commented Sep 29, 2023

This seems to correctly implement an RSS feed for shelves, closing #2871,

mattkatz added 2 commits September 28, 2023 21:49
Currently can't get the test to succeed - it fails in an unrelated redis
error, so pushing this so I can open a draft PR to get advice on a better
test.
mattkatz added 2 commits October 1, 2023 06:04
didn't really need to add the shelf to self and the linter doesn't like
seeing it outside of an init or setup.
@jaschaurbach
Copy link
Member

@mouse-reeve any idea why the test fails?

@mattkatz
Copy link
Author

@jaschaurbach good news is that it looks to be a very similar error from the failed test on github vs what I saw locally. Somehow I'm not mocking something out well enough and the test is trying to publish things to redis etc - none of that is set up in the test environment so everything goes boom. I hope to revisit this sometime when I can spend time figuring out why my test explodes.

It's frustrating to get the logic working locally but not the test, but for a project like this where it's just... some people ... working on it, I sympathize that there isn't time to triage the work of everyone that drops by with a pull request. If I can fix it, I will. If mouse or someone else competent sees what I'm doing wrong, that's great.

If I just need to pull an RSS feed of everything for my purposes and then filter out to just the to-read items, I can do that on my side.

@mattkatz
Copy link
Author

mattkatz commented Nov 5, 2023

@hughrun - all checks passed - hopefully the commits are not controversial.

@hughrun
Copy link
Contributor

hughrun commented Nov 5, 2023

@mattkatz the title of this is still 'DRAFT' - is this ready for review or are you still working on it?

@mattkatz mattkatz changed the title DRAFT: Rss for shelves RSS for shelves Nov 6, 2023
@mattkatz
Copy link
Author

mattkatz commented Nov 6, 2023

@mattkatz the title of this is still 'DRAFT' - is this ready for review or are you still working on it?

Fixed. This is ready for review.

@hughrun
Copy link
Contributor

hughrun commented Nov 7, 2023

@bookwyrm-social/code-review if someone has time to review this that would be awesome 🙂

@MaggieFero
Copy link
Contributor

This sounds so useful! I hope somebody has a chance to review it soon.

@dato dato self-requested a review March 6, 2024 21:47
Copy link
Contributor

@dato dato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for this feature, and apologies the review took so long. I'm sending you my suggestions, minus i18n issues (which I'll do in a second pass).

Most of these suggestions are minor, or self-explanatory. Please let me know what you think.

bookwyrm/urls.py Outdated Show resolved Hide resolved
bookwyrm/urls.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
@mattkatz
Copy link
Author

@dato - I'll take a look. And thank YOU for volunteering time to do this. I know this is real work and effort and I appreciate it. I'm checking it out now.

mattkatz and others added 6 commits March 12, 2024 21:43
This will make sure that users see books as they are shelved, which is what would be expected.

Co-authored-by: Adeodato Simó <[email protected]>
Co-authored-by: Adeodato Simó <[email protected]>
getting context data no longer seems needed, if it ever was.
@mattkatz
Copy link
Author

@dato thanks for the thorough review. I've addressed all comments.
I haven't added new tests around ordering - I don't know that it's worth the test load. If it's needed I'd update the test rss to add 2 books, figure out how to add a published date to each, then add the them to the shelf and expect that ordering is maintained.

Copy link
Contributor

@dato dato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me with the first two suggestions below!

bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/templates/rss/edition.html Outdated Show resolved Hide resolved
@dato
Copy link
Contributor

dato commented Mar 15, 2024

Ah one last thing for a follow-up PR: producing a <link rel="alternate" type="application/rss+xml" href="…" title="…" /> element in the template for public shelves (unlisted too?).

mattkatz and others added 4 commits March 18, 2024 21:29
Co-authored-by: Adeodato Simó <[email protected]>
in book_identifiers.html template we support multiple identifiers in
order.

This commit adopts the same logic and order
Copy link
Contributor

@dato dato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again—

I would like to merge soon so I can see some incremental value

Yes, I support this as well.

I think we can merge, with the tiny adjustments below (needed for a green build; I didn't provide good instructions for blocktrans usage, sorry).

bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/templates/rss/edition.html Outdated Show resolved Hide resolved
bookwyrm/templates/rss/edition.html Outdated Show resolved Hide resolved
@hughrun
Copy link
Contributor

hughrun commented Mar 25, 2024

I've spotted a few issues, review coming shortly.

Copy link
Contributor

@hughrun hughrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally seems to work, just a couple of things to clean up.

bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/templates/rss/edition.html Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/views/rss_feed.py Outdated Show resolved Hide resolved
bookwyrm/templates/rss/edition.html Outdated Show resolved Hide resolved
mattkatz and others added 5 commits April 14, 2024 04:48
If there is no author for a book, render just the title of the book.
Template blocks can't have logic or other blocks inside them.

This commit fixes the problem with the Edition template by removing the blocktrans block: original titles and descriptions shouldn't be translated, and this also makes the template simpler and avoids the logic-in-blocks problem.

Additionally if an edition is lacking a description, we fall back to the parent_work description, and line breaks have been added where needed.

Also adds a 'rel="alternate"' link to shelf pages to aid feed auto-discovery
@hughrun
Copy link
Contributor

hughrun commented Apr 26, 2024

@mattkatz I've made a PR in your repository with a fix for the template issue, and added a link the head to enable auto-discovery of the feeds.

Sorry, I kind of lead you in the wrong direction a bit with adding logic for missing authors. We can't put logic inside block tags. But when I thought about it more I realised we shouldn't be translating titles and descriptions anyway: e.g. if it's a book in French the title should be in French, not in whatever language I have my device set to display.

If you're happy with my changes just merge them in to your branch and they will flow through to this PR.

@hughrun
Copy link
Contributor

hughrun commented Aug 30, 2024

@bookwyrm-social/code-review can someone please double-check this, since I added the last commit here?

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.

5 participants