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.
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.