v1/variables problem with comma

Started by axel.hennig, March 28, 2022, 09:39:56 PM

Previous topic - Next topic



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 I just found that a comma within a string does not need to be escaped...


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.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook


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.