List of fields in the songs table

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

MPG
Posts: 282
Joined: Tue May 13, 2008 11:22 pm

List of fields in the songs table

Post by MPG »

Hi,
I am working on a search and replace add-on. I have a dropdown that I would like to populate with a listing of the fields that can be searched and have values replaced. While I could hard-code them, I don't believe that is the proper solution.

I found the following code that obtains the list of languages. Is there a way to get a listing of the fields?

<div data-id="cbDestination" data-control-class="Dropdown" data-init-params="{readOnly: true, dbFunc:'getStringList', dbFuncParams: {category: 'Languages'}, preload: true}" style="min-width: 20em"></div>

Is there some repository that can list all of the options for dbFuncParams?
TIA
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
dtsig
Posts: 3474
Joined: Mon Jan 24, 2011 6:34 pm

Re: List of fields in the songs table

Post by dtsig »

you can get a l ist of columns for all tables here https://www.mediamonkey.com/wiki/Databa ... _%28MM4%29
Where's the db and ini stored
Reporting Bugs
Where tags are stored

Not affiliated with MediaMonkey ... just a RABID user/lover
DTSig
drakinite
Posts: 645
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: List of fields in the songs table

Post by drakinite »

To answer your question, no, not yet*. Adding that now to my ever-growing to-do list :sweat_smile:

As a brief run-down:
- dbFunc can be any of the functions in app.db. If you open the dev console and type app.db, you can see all the possible methods (but some of them require SQL, and some of them support categories). The ones which take SQL are currently documented here: https://www.mediamonkey.com/docs/api/classes/DB.html
- To my knowledge, dbFunc and dbFuncParams are currently only used by the Dropdown control.

Categories currently supported by getPeople:
- artist, author, conductor, producer, director, screenwriter, actor, lyricist

Categories currently supported by getStringList:
- collection, CPUCores, PlayActions, PlayNowActions, Languages, addonCategories, trackType, album, parentalrating, genre, tempo, mood, occasion, quality, extendedTags, coverTypes, initialKey, empty

Actually, it looks like getPeople and getStringList are the only db functions that support that "category" format. Might not be as tedious to add to the documentation, in fact.
*Edit: DB API documentation has been added; it'll be added to the web docs next time they're updated.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
drakinite
Posts: 645
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: List of fields in the songs table

Post by drakinite »

Also, if you want a list of all fields, check uitools.tracklistFieldDefs. Defined in controls/trackListView.js.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
Post Reply