getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: boroda on July 09, 2021, 09:05:37 PM

Title: "Evaluate()" API function reqest
Post by: boroda on July 09, 2021, 09:05:37 PM
Steven, could you implement Evaluate(siring) API function, which accepts any expression valid for virtual tag? It will make possible to use virtual tag functions in Advanced Search & Replace command of Tag Tools plugin (without defining virtual tags just to use these functions).
Title: Re: "Evaluate()" API function reqest
Post by: Steven on July 09, 2021, 11:43:29 PM
good idea and i will do that, but it would also need to take a file url as a parameter ie. Evaluate("expression",url)
Title: Re: "Evaluate()" API function reqest
Post by: boroda on July 11, 2021, 10:47:35 AM
good idea and i will do that, but it would also need to take a file url as a parameter ie. Evaluate("expression",url)
i think, yes. thanks for suggestion.
no, Steven, the purpose of this function is opposite to what you suggested: <url> or any other (pseudo)tags must be passed as parameters in function input. i.e. instead of creating virtual tag with formula (for example) "$Len(<URL>)" we could call function Evaluate("$Len(<URL>)") without creating new virtual tag (which count is limited).
Title: Re: "Evaluate()" API function reqest
Post by: Steven on July 11, 2021, 11:45:18 AM
The purpose of the url parameter is so MB knows which file to apply the virtual tag expression against. The returned value from Evaluate will be the result for the file.
If thats not what you had in mind then you will need to explain what evaluate returns if its just Evaluate("$Len(<URL>)") without knowing which file it is being applied against
Title: Re: "Evaluate()" API function reqest
Post by: boroda on July 11, 2021, 12:44:28 PM
yes, you are right. i can't call GetFileTag() without defining virtual tag. so i need to provide track url explicitly for Evaluate(expression, url) function.
Title: Re: "Evaluate()" API function reqest
Post by: boroda on July 11, 2021, 01:44:53 PM
Steven, never mind. I was thinking in terms of ASR preset definition, not in terms of MusicBee API, and got confused. What I actually need is just what you suggested: Evaluate(expression, url) API function. Excuse me.