photools.com Community

IMatch Bug Reports and Feature Requests => Bug Reports => Solved Bug Reports (for next version) => Topic started by: axel.hennig on March 28, 2022, 09:39:56 PM

Title: v1/variables problem with comma
Post by: axel.hennig on March 28, 2022, 09:39:56 PM
Hello,

I'm currently using the v1/variables endpoint and I would like to get GPSLatitude,GPSLongitude. What I'm currently doing is:


let myLocation = await IMWS.get('v1/variables',{
    idlist: 'myIdlist',
    var: '{File.MD.XMP::exif\\GPSLatitude\\GPSLatitude\\0|value:raw} , {File.MD.XMP::exif\\GPSLongitude\\GPSLongitude\\0|value:raw}'
});


But this does not work, it just returnes the GPSLatitude. I've also tried to "escape" the comma with "\," but also didn't work.

What works e.g. is (switching from comma to semicolon):

let myLocation = await IMWS.get('v1/variables',{
    idlist: 'myIdlist',
    var: '{File.MD.XMP::exif\\GPSLatitude\\GPSLatitude\\0|value:raw} ; {File.MD.XMP::exif\\GPSLongitude\\GPSLongitude\\0|value:raw}'
});


Is someone able to give me a hint what I'm doing wrong? On stackoverflow (https://stackoverflow.com/questions/4997634/how-to-escape-comma-in-javascript) I just found that a comma within a string does not need to be escaped...
Title: Re: v1/variables problem with comma
Post by: Mario on March 29, 2022, 09:24:48 AM
This endpoint was supposed to support multiple variables, separated by ,
But this was never implemented, hence it processes only the first variable.
Since nobody ever complained, I doubt that fixing this will affect any apps in the wild, so I will fix this for the next release.
You can use the more commonly used v1/files endpoint with the var** parameters (any number) to fetch multiple variables in one go, and then format them as required.
Title: Re: v1/variables problem with comma
Post by: axel.hennig on March 29, 2022, 11:20:59 AM
Thanks. After my post I figured out that the v1/files endpoint is quite powerful (much more than I thought after first usage/reading the doc). Currently no need for me to use the v1/variables endpoint right now.