Author Topic: "Evaluate()" API function reqest  (Read 10025 times)

boroda

  • Sr. Member
  • ****
  • Posts: 4595
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).

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
good idea and i will do that, but it would also need to take a file url as a parameter ie. Evaluate("expression",url)
Last Edit: July 10, 2021, 12:57:40 AM by Steven

boroda

  • Sr. Member
  • ****
  • Posts: 4595
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).
Last Edit: July 11, 2021, 11:25:29 AM by boroda

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
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

boroda

  • Sr. Member
  • ****
  • Posts: 4595
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.
Last Edit: July 11, 2021, 12:48:13 PM by boroda

boroda

  • Sr. Member
  • ****
  • Posts: 4595
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.