Skip to content

Fix tumblr liked-by pagination detection#586

Merged
thomas694 merged 3 commits intoTumblThreeApp:masterfrom
valepakh:valepakh/fix_liked_by_pagination
Dec 10, 2024
Merged

Fix tumblr liked-by pagination detection#586
thomas694 merged 3 commits intoTumblThreeApp:masterfrom
valepakh:valepakh/fix_liked_by_pagination

Conversation

@valepakh
Copy link
Copy Markdown
Contributor

@valepakh valepakh commented Dec 6, 2024

Checklist

Confirm you have completed the following actions prior to submitting this PR.

  • There is an existing issue report for this PR.
  • I have forked this project.
  • I have created a feature branch.
  • My changes have been committed.
  • I have pushed my changes to the branch.

Title

Give your PR a short title summarising the patch, bug fix or feature.

Description

Ensure the PR description clearly describes the problem and solution and provide as much relevant information as possible.

Issue Resolution

This Pull Request Fixes #585

Proposed Changes

Check if the regex actually matches.

New or Changed Features

Does this PR provide new or changed features or enhancements? If so, what is included in this PR?

Copy link
Copy Markdown
Contributor

@thomas694 thomas694 left a comment

Choose a reason for hiding this comment

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

Thanks for your PR.

Yes, something has changed on the Likes pages, which is causing the error found on the last page.

try
{
url = nextPage.Take(Ct);
if (!nextPage.TryTake(out url))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did an error pop up here or do you just not like the Take method?
By using this overload of the TryTake method, could a side effect occur?

Copy link
Copy Markdown
Contributor Author

@valepakh valepakh Dec 9, 2024

Choose a reason for hiding this comment

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

Did an error pop up here or do you just not like the Take method?

The InvalidOperationException from the Take does pop out in the console when there're no pages to take anymore. It seems cleaner to check if there was something in the collection or not.

By using this overload of the TryTake method, could a side effect occur?

The difference between them is that the TryTake will immediately return if the collection is empty, while the Take method will throw an exception only if it's empty and the collection is complete. Correct me if I'm wrong, but in this case there're no other threads that populate it so if we didn't add a new page at the end of the loop we should exit it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

... but in this case there're no other threads...

What about the tasks in the calling method? Could we use another overload of the TryTake method?
However, upon closer inspection, one might suspect that there may be another problem preventing it from executing as originally intended.

Copy link
Copy Markdown
Contributor

@thomas694 thomas694 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this bug.

@thomas694 thomas694 merged commit 64f1279 into TumblThreeApp:master Dec 10, 2024
@thomas694
Copy link
Copy Markdown
Contributor

I have added you to our contributors list, feel free to fix more bugs.

@valepakh valepakh deleted the valepakh/fix_liked_by_pagination branch December 11, 2024 09:49
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.

Tumblr liked-by fails: Error parsing post

2 participants