View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0018998 | MMW 5 | Extensions framework | public | 2022-04-22 22:26 | 2022-05-25 16:39 |
Reporter | zvezdan | Assigned To | |||
Priority | urgent | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | reopened | ||
Product Version | 5.0.3 | ||||
Target Version | 5.0.3 | Fixed in Version | 5.0.3 | ||
Summary | 0018998: Playlist event handlers are incorectly stated in API, some are missing, some are unuseful | ||||
Description | The old OnPlaylistChanged is not replaced with 'playlistChanged' as it is used in VBStoJS, but with 'playlistchange'. API is correct. The old OnPlaylistRemoved is indeed replaced with 'playlistRemoved' as it is in VBStoJS, but it is nowhere mentioned in API. The old OnPlaylistAdded has no functional replacement; the 'playlistAdded' can be registered, but it doesn't fire at all. Not mentioned in API either. The playlistRemoved event handler should have the playlist object as an argument as it was in MM4, not the playlist's id. I used its object in my add-ons to display the title of the removed playlists and for other things. | ||||
Tags | No tags attached. | ||||
Fixed in build | 2617 | ||||
|
Went through all native events and updated their documentation to reflect the correct event name. - playlistChange event on the App object is new. - playlistChanged, playlistRemoved, and playlistAdded events are tied to the Playlist class, to be accessed via app.playlists.root unless you want to deal with child playlists. Added them to the API documentation. - You can use app.playlists.getByIDAsync (https://www.mediamonkey.com/docs/api/classes/Playlists.html#method_getByIDAsync) to get a playlist from its ID. - Confirmed that playlistAdded does not fire as expected. To be fixed in build 2617. |
|
When you mentioned app.playlists.getByIDAsync, did you mean on playlistRemoved? Since that doesn't work, it returns undefined. Otherwise I wouldn't reported the issue. |
|
And just for your information, I tried also app.db.getQueryResultAsync('SELECT * FROM Playlists WHERE IDPlaylist = ' + plsId) without success. |
|
Re "When you mentioned app.playlists.getByIDAsync, did you mean on playlistRemoved? Since that doesn't work, it returns undefined. Otherwise I wouldn't reported the issue.": Good point. Assigning to Ludek to triage the suggestion of making playlistRemoved return the playlist information instead of its ID, as the ID is useless in that case. |
|
Fixed in 2617. 'playlistAdded' is now fired on proper parent + also bubbles. So any new playlist can be listened either on app.playlists.root (or a possible sub-parent -- once it is deeper in the hierarchy) 'playlistRemoved' has the playlist object as parameter now (not just id) |
|
Verified 2619 Using small test script sample. Test Note: 'playlistAdded' Tested up to 4th sub-parrent 'playlistRemoved' correctly return Playlist object |
|
Updated JSdoc for playlistRemoved to reflect the new behavior. |