photools.com Community

IMatch Bug Reports and Feature Requests => Feature Requests => Archive (Feature Requests) => Topic started by: PandDLong on April 15, 2021, 12:41:50 AM

Title: Variable for date-time File Metadata Changed
Post by: PandDLong on April 15, 2021, 12:41:50 AM

Can a file variable be added that provides the datetime stamp for when the metadata was last changed in the database for the file?

This data is in the History panel but can't be accessed by a variable (at least I didn't find it listed in Help nor the Variable Selector and I did a few attempts in VarToy with various spellings - but I expect it isn't exposed to the variables capability at all).

Thanks for considering.
Title: Re: Variable for date-time File Metadata Changed
Post by: Ger on April 15, 2021, 07:58:05 AM
Try


function getHistoryData() {
           IMWS.get('v1/files', {
            idlist: IMatch.idlist.fileWindowSelection,
                fields: 'id,name,history',
           }).then(function(r) {
            if (r.files.length > 0) {
                    resultJSON.html(JSON.stringify(r, null, 2));
           
                    });
                };
           });
        };


The JSON will look like:


{
  "files": [
    {
      "id": 4089,
      "name": "20060530_162411_1234.jpg",
      "history": [
        {
          "event": {
            "type": 1,
            "name": "added",
            "id": 4089,
            "id2": 0,
            "dateTime": "2019-02-24T12:20:47",
            "title": "",
            "text": "",
            "user": "Ger"
          }
        },
        {
          "event": {
            "type": 2,
            "name": "updated",
            "id": 4089,
            "id2": 0,
            "dateTime": "2019-02-24T12:21:12",
            "title": "",
            "text": "",
            "user": "Ger"
          }
        },
        {
          "event": {
            "type": 60,
[...]
Title: Re: Variable for date-time File Metadata Changed
Post by: Mario on April 15, 2021, 10:54:13 AM
Does {File.MD.XMP::xmp\ModifyDate\ModifyDate} not work for you? Or the shortcode {File.MD.modifydate}?
Title: Re: Variable for date-time File Metadata Changed
Post by: PandDLong on April 15, 2021, 04:28:02 PM

File.MD.modifydate seems to correspond to when metadata is last modified in the file.   ie. it corresponds almost exactly to 'Updated' in the History panel.

I was hoping for the datetime corresponding to 'Metadata changed' in the History panel. 


I haven't done any scripting yet with iMatch - perhaps it is time to start...

Michael
Title: Re: Variable for date-time File Metadata Changed
Post by: Mario on April 15, 2021, 04:58:59 PM
Yes. IMatch does not maintain separate variables to keep track on when you modified metadata of a file in the Keywords Panel, Metadata Panel or by one of the many other means.
The history is not accessible via variables (complex struct, never requested) but via the v1/files endpoint.

The history is one of the most overlooked features in IMatch for 'normal' users - it was added initially for commercial and institutional users.