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

int('') causes server listing to fail #5

Merged
merged 1 commit into from
Mar 5, 2019

Conversation

ddurdle
Copy link

@ddurdle ddurdle commented Mar 4, 2019

by casting int() around an incoming xml variable, you assume it is defined. Apparently, valid values for these returned by plex can be 0, 1 or ''. So the cast fails and causes an unhandled exception.

To ensure there is always a proper value or 0 will ensure that a value of 0 is returned when there is '' defined.

by casting int() around an incoming xml variable, you assume it is defined.  Apparently, valid values for these returned by plex can be 0, 1 or ''.  So the cast fails and causes an unhandled exception.  

To ensure there is always a proper value or 0 will ensure that a value of 0 is returned when there is '' defined.
Copy link
Owner

@zSeriesGuy zSeriesGuy left a comment

Choose a reason for hiding this comment

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

Good catch. Thank you.

@zSeriesGuy zSeriesGuy merged commit 73137cb into zSeriesGuy:V3.0.00 Mar 5, 2019
@@ -686,16 +686,16 @@ def get_servers_list(self, include_cloud=True, all_servers=False):
helpers.get_xml_attr(c, 'local') == '0':
continue

server = {'pms_ssl': 1 if is_cloud else int(helpers.get_xml_attr(d, 'httpsRequired')),
server = {'pms_ssl': 1 if is_cloud else int(helpers.get_xml_attr(d, 'httpsRequired') or 0),

Choose a reason for hiding this comment

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

you could use default_return also :)

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.

None yet

3 participants