getTracklist conditionally returning incorrect results

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: getTracklist conditionally returning incorrect results

Re: getTracklist conditionally returning incorrect results

by PetrCBR » Tue May 02, 2017 9:48 am

Thanks. Will be improved in next build.

getTracklist conditionally returning incorrect results

by TIV73 » Sun Apr 30, 2017 3:34 am

Hi everybody,
I noticed that in build 2064 the functions getTracklist() and getSelectedTracklist() only return correct results if the main track list has focus when calling the function. If the functions are called before the track list had focus or after it lost focus by clicking the media tree (it's not needed to change the active node, just clicking the white space is enough), null is returned. To reproduce try the following:
  • - Open mediamonkey
    - Open the chrome dev tools
    - Open a node containing songs
    - Highlight a few songs
    - Run uitools.getTracklist().count and uitools.getTracklist().count in the dev console, both should return the correct total and selected track count, respectively
    - While the tracks are still selected, click on whitespace on the media tree on the left
    - Run both commands again, an error will be generated because null was returned by both functions
The same applies if you use the media tree to navigate to a node containing songs (e.g. Music > All Tracks) and then call the function or if you call the function right after starting mediamonkey before the track list had focus once. This can also be tested with the fixTrailingThe example extension since it uses both functions.

Top