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

Fix podnapisi results parsing #2383

Merged
merged 1 commit into from
Feb 8, 2024
Merged

Fix podnapisi results parsing #2383

merged 1 commit into from
Feb 8, 2024

Conversation

tomislav
Copy link
Contributor

@tomislav tomislav commented Feb 8, 2024

No description provided.

@morpheus65535 morpheus65535 merged commit 27d7f96 into morpheus65535:development Feb 8, 2024
2 checks passed
@morpheus65535
Copy link
Owner

Thanks!

@tomislav
Copy link
Contributor Author

tomislav commented Feb 8, 2024

On second thought, using or might be correct after all.

if not xml.find('pagination/results') or not int(xml.find('pagination/results').text):
    logger.debug('No subtitles found')
    break

The condition is checking two things:

  • If xml.find('pagination/results') returns None.
  • If the text of xml.find('pagination/results') is 0 or an empty string

If either of these conditions is true, it means no subtitles were found. Using and could cause a potential exception when trying to access the text property.

Sorry, I got a little lost in all the not's and and's :)

Still not sure why it's not working with or though.

@tomislav
Copy link
Contributor Author

tomislav commented Feb 8, 2024

Yeah, after more testing this PR is not going to work out. Please revert while I investigate more.

@morpheus65535
Copy link
Owner

Done

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.

2 participants