Magnets added with a label have the label removed when magnet metadata is received #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When on_torrent_added is executed and there is a pending label the label is set correctly. Unfortunately, when the recently added on_torrent_metadata_received is handled it calls on_torrent_added again. On this second call the autolabel value is used whether it is ID_NONE or not. The on_torrent_added handler was not originally designed to be called twice for the same torrent.
This PR makes it possible for it to be called twice. First time it'll use the pending label. Second time it'll use an autolabel only if it is not ID_NONE.