Download Album does nothing when multiple songs are selected
Submitted by Brent Goodrick
Link to original bug (#499671)
Description
Please describe the problem: When browsing the albums in the Jamendo plugin, I expect to be able to download the albums via an external Bittorrent client. If I select multiple songs in the song list, and select Download Album from the right-mouse-button (context menu), nothing happens. If I select only a single song, then it works as expected.
Steps to reproduce:
- Select multiple song entries in the Jamendo list
- Right mouse click, select Download Album
- Nothing happens. Nothing visible happens.
- Then select only one song.
- Right mouse click, select Download Album
- The Firefox browser pops up asking me what to do with the torrent file (and that is correct behavior for me in my setup since Firefox will ask me to save the .torrent file where my bittorrent client can detect it and start downloading the .torrent file.
Actual results: See "reproduced" field.
Expected results: Something visible like the bittorrent client be invoked, and in this case, the Firefox browser browse the .torrent file, but others may have other setups.
Does this happen every time? Yes, repeatedly
Other information: I have a hack fix that demonstrates where in the code the problem needs to be fixed, but is not necessarily the best change for this. Look at the plugins/jamendo/JamendoSource.py file, find the download_album function. Notice the if statement right under the TODO comment. The if condition is:
if len(tracks) == 1:
Change that line to:
if len(tracks) != 0:
And the Download Album functionality works.
The above is a hack because it ignores what should happen when multiple songs from different albums are selected before the user requests to Download Album. Since it might be problematic to send multiple urls in a loop via the __download_p2plink function; if that is the case, then the plugin could perhaps prompt the user with an error reminding them to select a single album at a time.
Version: 0.11.x