Skip to content

[fix] anilist: Exception if field is not set on the site#2710

Merged
gazpachoking merged 6 commits intoFlexget:developfrom
BrutuZ:anilist-update
Oct 16, 2020
Merged

[fix] anilist: Exception if field is not set on the site#2710
gazpachoking merged 6 commits intoFlexget:developfrom
BrutuZ:anilist-update

Conversation

@BrutuZ
Copy link
Copy Markdown
Contributor

@BrutuZ BrutuZ commented Jul 22, 2020

Motivation for changes:

Discovered that site entries could have empty fields, usually ones added from very early announcements or teasers. That would result in exceptions due to parsing errors since some fields were taken for granted.

Detailed changes:

  • Replaced most direct references to dict keys with dict().get()
  • Convert to string before performing case operations to avoid NoneType exceptions
  • Changed al_links output:
    • From Dicts inside a List: [{'site': '*site_name*', 'url': '*site_url*'}, ... ]
    • To single Dict: {'*site_name*': '*site_url*', ... }
  • Alphabetize Entry() fields to improve code readability

BrutuZ added 2 commits July 22, 2020 11:48
Alphabetize Entry() fields to make code more readable
Copy link
Copy Markdown
Member

@liiight liiight left a comment

Choose a reason for hiding this comment

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

that build failure seems unrelated, looking into it

@BrutuZ
Copy link
Copy Markdown
Contributor Author

BrutuZ commented Jul 23, 2020 via email

@ianstalk
Copy link
Copy Markdown
Contributor

ianstalk commented Jul 23, 2020 via email

@BrutuZ
Copy link
Copy Markdown
Contributor Author

BrutuZ commented Jul 24, 2020

Testing for empty value now

@BrutuZ BrutuZ requested a review from ianstalk July 25, 2020 20:25
@BrutuZ BrutuZ requested a review from liiight August 2, 2020 21:16
@BrutuZ
Copy link
Copy Markdown
Contributor Author

BrutuZ commented Oct 6, 2020

Bump.

I'm stuck at this 3.1.68 branch since a couple of entries in my list have empty values that aren't handled without this, hence crashing the task.

@BrutuZ
Copy link
Copy Markdown
Contributor Author

BrutuZ commented Oct 16, 2020

Paging @Flexget

@gazpachoking
Copy link
Copy Markdown
Member

Seems good to me, thanks!

@gazpachoking gazpachoking merged commit 557963c into Flexget:develop Oct 16, 2020
@BrutuZ BrutuZ deleted the anilist-update branch October 13, 2021 23:55
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.

4 participants