getTracklist conditionally returning incorrect results

Help improve MediaMonkey 5 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

TIV73
Posts: 229
Joined: Sat Nov 12, 2011 1:31 pm

getTracklist conditionally returning incorrect results

Post by TIV73 »

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.
PetrCBR
Posts: 1763
Joined: Tue Mar 07, 2006 5:31 pm
Location: Czech
Contact:

Re: getTracklist conditionally returning incorrect results

Post by PetrCBR »

Thanks. Will be improved in next build.
How to make a debuglog - step 4b: viewtopic.php?f=30&t=86643
Post Reply