View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0009138||MediaMonkey (current)||Framework: Scripts/Extensions||public||2012-02-14 20:51||2012-02-14 20:57|
|Summary||0009138: Method to update tree and tracklist after SQL modifications to Medias table needed|
|Description||I have script which updates Drive-ID and/or paths of files in database using SQL modifying Medias and/or Songs tables (http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=63823). If works fine, but there is an issue because I am using some dirty tricks collapsing/expanding nodes and especially dirty one which is using the SendKeys command.|
Let say that I have the database with only one drive which doesn't exist anymore (or it is inaccessible) and let say that my script updates drive ID for some files from that drive to the drive C: which exists. To be able to see that new drive in the Tree panel I need to collapse and expand the Location branch. However, the paths in the tracklist are still incorrect displaying :\xxx\xxx instead of C:\xxx\xxx. Those paths are displaying fine after the restart of the program or if I select C: node in the Location branch, then choose Shift+Enter for Properties and press Enter, but I don't want to force users of my script to that step.
There is one more solution which I am using with the help of the mentioned SendKeys method. If I press F2 (or choose Rename from the pop-up menu), retype the existing drive label and press Enter, the paths in the tracklist would be updated. So, with SendKeys I am simulating press of F2, typing of the existing drive label and press of Enter. However, for that to work the tree panel should be displayed (i.e. it should be enabled in View menu) and the script should transfer keyboard focus to it. Also, such solution doesn't work in MM4 always, but only if the Medias table contained previously the new drive during the last program session. Otherwise, the program simply refuses press on F2 and modifying of the drive label. MM2 and MM3 didn't have that problem, they accepted modification of the label with F2 for every drive, not matter if it is accessible.
So, it would be nice if you update some existing method like MainTracksWindow.Refresh or MainTree.Refresh or if you add some new method to update paths in the tracklist made by modification of the Medias table. The current implementation doesn't do that, i.e. nothing is happening after:
|Tags||No tags attached.|
|Fixed in build|