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

tumblr sometimes returns an empty json array for Attribution rather than an object #579

Closed
mjharwood opened this issue Oct 26, 2024 · 3 comments · Fixed by #582
Closed

Comments

@mjharwood
Copy link
Contributor

Describe the bug

Unhandled exception parsing the json object returned from tumblr.

instead of:

 "content": [
    {
       "attribution": {
       "type": "link",
       "url": "https://64.media.tumblr.com/....."
        },
   },

it returns:

content": [
  {
     "attribution": [
      ],

To Reproduce
seems to be on occasional posts, no particular pattern to trigger it

Expected behavior
post is successfully downloaded

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • TumblThree version: 2.15.1.0 (running current master under VS)
  • OS: Windows 11

Additional context

This, and many other fields, are not used by the application so could just be removed / disabled in TumblrTaggedSearchJson : Content to prevent this issue. The json parser just skips fields that aren't mapped.

I can produce a PR if that would be helpful.

@thomas694
Copy link
Contributor

Hello,
I would not remove the fields so that the complete data object can still be saved, but change it so that either an object or an array can be processed in the respective field.
Yes, you can produce a PR.

@mjharwood
Copy link
Contributor Author

Is there some debugging that saves the complete data object? Otherwise it's less overhead to just drop the unwanted fields.

Unless there's some json.net magic I'm not aware of, mapping an array and a typed object to the same field in C# is going to be very difficult and not worth it for data the application doesn't need.

I might be missing something obvious, it's a while since I used json.net for parsing.

@thomas694
Copy link
Contributor

There's an option "dump crawler data" to store the complete JSON data.

I rather think that there has already been done something similar for a property of one of the crawlers before, with a custom JSON converter I guess.

mjharwood pushed a commit to mjharwood/TumblThree that referenced this issue Oct 31, 2024
TumblrSearchJson does the same thing (the objects are identical except for one field)

refs TumblThreeApp#579
mjharwood pushed a commit to mjharwood/TumblThree that referenced this issue Oct 31, 2024
TumblrSearchJson does the same thing (the objects are identical except for one field)

refs TumblThreeApp#579
mjharwood added a commit to mjharwood/TumblThree that referenced this issue Oct 31, 2024
TumblrSearchJson does the same thing (the objects are identical except for one field)

refs TumblThreeApp#579
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 a pull request may close this issue.

2 participants