Skip to content

Properly use the downloaded torrent file in the qBittorrent plugin (except on magnet links).#1397

Merged
cvium merged 4 commits intoFlexget:developfrom
dsemi:develop
Sep 9, 2016
Merged

Properly use the downloaded torrent file in the qBittorrent plugin (except on magnet links).#1397
cvium merged 4 commits intoFlexget:developfrom
dsemi:develop

Conversation

@dsemi
Copy link
Copy Markdown
Contributor

@dsemi dsemi commented Sep 8, 2016

Motivation for changes:

Make qbittorrent more like the other client plugins.

Detailed changes:

Allow qBittorrent plugin to properly handle input torrent files and magnet links.
Also merge change to set 'label' as 'category' since qBittorrent decided to change the API and the original PR looks abandoned.

Addressed issues:

@liiight
Copy link
Copy Markdown
Member

liiight commented Sep 8, 2016

I'm gonna test this later today

with open(filepath, 'rb') as f:
multipart_data['torrents'] = f
self.session.post(self.url + '/command/upload', files=multipart_data)
log.debug('Added task to qBittorrent')
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 doesn't sound right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@cvium Can you be more specific?

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.

You don't add a task, you add entries. The debug message is pointless as it provides no information.

@cvium
Copy link
Copy Markdown
Contributor

cvium commented Sep 8, 2016

I took the liberty of re-inserting the template you deleted. Please fill it with the proper information. It's there to help us.

@dsemi
Copy link
Copy Markdown
Contributor Author

dsemi commented Sep 8, 2016

Made the changes.

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.

You should negate the expression if you want to call it is_magnet.

@cvium
Copy link
Copy Markdown
Contributor

cvium commented Sep 9, 2016

@dsemi I assume you've tested it?

log.info('Test mode.')
log.info('Would add torrent to qBittorrent with:')
if not is_magnet:
log.info(' File: %s', entry.get('file'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't use empty space prefixes / indentations in log messages.

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.

Not entirely true. It's used in other places for indentation.

@paranoidi
Copy link
Copy Markdown
Member

Looks pretty good

@dsemi
Copy link
Copy Markdown
Contributor Author

dsemi commented Sep 9, 2016

@cvium Yes

@paranoidi Removed the spaces.

@cvium cvium merged commit 12c76ef into Flexget:develop Sep 9, 2016
@liiight
Copy link
Copy Markdown
Member

liiight commented Sep 10, 2016

For what it's worth, tested in master and seem to work well.
Thanks for this!

@dsemi
Copy link
Copy Markdown
Contributor Author

dsemi commented Sep 10, 2016

No problem :)

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