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

Add notes functionality #138

Merged
merged 48 commits into from
Dec 26, 2024
Merged

Add notes functionality #138

merged 48 commits into from
Dec 26, 2024

Conversation

syeopite
Copy link
Owner

@syeopite syeopite commented Nov 8, 2024

No description provided.

@syeopite syeopite force-pushed the add-notes-functionality branch from c28d0ac to 33bac0d Compare December 22, 2024 02:22
All attributes were set to zero. Oops.
The URL parameter `field[blogs]` allows us to customize what fields
are returned by Tumblr in regards to blog information.

However, in an effort to mimic the official clients we use the exact
same `field[blogs]`as official requests. Thus when Tumblr sets
`field[blogs]` to something that doesn't return everything we require
the typical parsing fails.

As a workaround this commit adds the new method `parse_limited` as to
handle the special edge case when `field[blogs]` doesn't contain all
of the fields we need.

The logic is separated because of the fact that this is a special case
only seen in the requests for notes. In all other requests the
`field[blogs]` attribute is set to return everything we need instead of
only the name, avatar and theming information.
When blog[fields] is not specified the `theme` object will still be
present except with only one attribute: avatar_shape
Reuses the template for posts for conveniences sake
The return the oldest reblogs by default
as well as with a type of reblog_with_comments
Reblog notes should not have the regular footer interaction buttons
seen on regular posts
The post url is generated quite a few times in the template
due to the need to check whether to include the slug or not.

By generating this in the routing logic instead we can increase
performance by eliminating the duplicate creations of the post url
post.jinja is used in more places than just the
route that renders a single post and in those places
a post url isn't generated
Use babel to provide locale specific formattings for the numbers
These attributes are always false as we are fetching
the post data without an account

In addition due to the way we were locking the counts for
the various note types behind these attributes being true

The fact that they are always false means that we never
actually parse the counts for the note types
@syeopite syeopite force-pushed the add-notes-functionality branch from 33bac0d to 465efd0 Compare December 26, 2024 04:16
@syeopite syeopite marked this pull request as ready for review December 26, 2024 04:19
@syeopite syeopite merged commit f5f99c9 into master Dec 26, 2024
1 check passed
@syeopite syeopite deleted the add-notes-functionality branch December 26, 2024 04: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.

1 participant