Skip to content

support size unit of "B". if sizes doesn't match log and ignore.#1441

Merged
cvium merged 3 commits intoFlexget:developfrom
lostsubstance:patch-1
Oct 13, 2016
Merged

support size unit of "B". if sizes doesn't match log and ignore.#1441
cvium merged 3 commits intoFlexget:developfrom
lostsubstance:patch-1

Conversation

@lostsubstance
Copy link
Copy Markdown
Contributor

some results were so small they reported bytes and the regex didn't match. (resulting in an exception being thrown) This makes missed parses of size not trigger an exception, as well as supporting Bytes.

some results were so small they reported bytes and the regex didn't match. 
this makes missed parses of size not trigger an exception. as well as supporting Bytes.
if size:
entry['content_size'] = parse_filesize(size.group(1))
else:
log.error('Malformed search result? Title: "%s", No size? %s' % (entry['title'], sizeText))
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.

Let the logger handle string formatting. Use a comma instead of %

entry['content_size'] = parse_filesize(size.group(1))
else:
log.error('Malformed search result? Title: "%s", No size? %s' % (entry['title'], sizeText))
log.error('Malformed search result? Title: "%s", No size? %s', (entry['title'], sizeText))
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.

That's not gonna work. You need to remove the parenthesis around the variables. This is gonna crash since you're passing a tuple.

@cvium cvium merged commit b9dbe9f into Flexget:develop Oct 13, 2016
@cvium
Copy link
Copy Markdown
Contributor

cvium commented Oct 13, 2016

Thanks

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