How to determine music library path in a script?

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

版主: GurusAddon Administrators

回复
pokeefe0001
帖子: 97
注册时间: 周四 10月 11, 2018 4:48 pm

How to determine music library path in a script?

帖子 pokeefe0001 »

I have need to find the path to our music library in a script. Luckily, each of our instances of MediaMonkey has just one library. Unluckily, we have multiple instances of portable MediaMonkey with the library in various locations.

I found a chunk of code that works:

代码: 全选

  Set TrackData = SDB.Database.QuerySongs(" ")
  If Not TrackData.EOF Then
      'TrackData.Item is a SDBSongData Object
      TrackPath = TrackData.Item.Path
  End If
That works fine and doesn't have a noticeable delay. However, as near as I can tell, that extracts data for all tracks in the database (which for us is over 3000) and I really need only one. I don't know enough about QuerySongs to know how to limit the search to just one hit. Is there a way to do that? I'm sure there's a way search for a specific title (or some such), and I guess that would use less storage for the result, but it would still search the entire database so that's not much of an improvement.
MMV4 (1919) Portable
MMW5 (2606) Portable
Multiple Win11 x64 21H2
Multiple Win7 x32, unknown builds
回复