Skip to content

[add] bittorrent - expose torrent name in Torrent class#1862

Merged
cvium merged 2 commits intodevelopfrom
bt-name
Jun 3, 2017
Merged

[add] bittorrent - expose torrent name in Torrent class#1862
cvium merged 2 commits intodevelopfrom
bt-name

Conversation

@tubedogg
Copy link
Copy Markdown
Contributor

@tubedogg tubedogg commented Jun 3, 2017

Motivation for changes:

The name attribute of the info dictionary in the torrent file is often used as the container folder name in various torrent programs. However, this is not exposed in FlexGet.

Detailed changes:

  • name is now a property of the Torrent class and returns the name attribute of the info dictionary from the torrent file.

@tubedogg tubedogg changed the title [add] bittorrent - expose torrent name in entry[‘torrent’].name [add] bittorrent - expose torrent name in Torrent class Jun 3, 2017

@property
def name(self):
"""Return name of the torrent"""
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.

Why False?

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.

Because I was copying from private. It should be an empty string.


@property
def name(self):
"""Return name of the torrent"""
Copy link
Copy Markdown
Contributor

@cvium cvium Jun 3, 2017

Choose a reason for hiding this comment

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

My point was rather, why return something specific at all? get will return None if the key isn't set. But maybe an empty string will be better for jinja etc. Dunno.

@cvium cvium merged commit 6ed5a20 into develop Jun 3, 2017
@cvium cvium deleted the bt-name branch June 24, 2017 05:45
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