photools.com Community

IMatch Bug Reports and Feature Requests => Feature Requests => Archive (Feature Requests) => Topic started by: ubacher on June 15, 2017, 09:52:44 PM

Title: Initiating a rescan of a folder via scripting
Post by: ubacher on June 15, 2017, 09:52:44 PM
I am in need of a way to initiate a rescan of a folder (and optionally its subfolders) from a script.
(As was available in IM5).
Title: Re: Initiating a rescan of a folder via scripting
Post by: Mario on June 15, 2017, 10:12:26 PM
Folder rescans are automatic. I know that you for some reason have disabled this automatic functionality.
IMatch WebServices automatically rescans folders automatically, there is no option to disable this. I don't know if it will be effective to implement this functionality just for one user who combines scripts and a disabled automatic folder rescan. Lets's see how many +1 this gets.
Title: Re: Initiating a rescan of a folder via scripting
Post by: ubacher on June 17, 2017, 10:46:36 AM
QuoteIMatch WebServices automatically rescans folders automatically

But when I moved a file to a sub-folder in my script it did not add the file to the folder. (reported elsewhere).
What would I have to do (in a script) to show/test this automatic rescan?
Title: Re: Initiating a rescan of a folder via scripting
Post by: Mario on June 17, 2017, 12:46:05 PM
As the documentation of the IMatch.moveFile function say: This is for using normal files, not moving files which are indexed in your database. This functions exists because JavaScript cannot access the file system.

As I wrote yesterday, you will have to wait until I figured out a safe way to implement a moveFile / copyFile / deleteFile / ... function in IMWS itself. Such an endpoint will keep the database up-to-date automatically.
Title: Re: Initiating a rescan of a folder via scripting
Post by: ubacher on June 18, 2017, 10:44:25 AM
I assume doing it in IMWS is difficult.
I don't need IMWS - I only run embedded. Would that be much easier?
Title: Re: Initiating a rescan of a folder via scripting
Post by: Mario on June 18, 2017, 11:01:10 AM
All database-related functionality provided in IMatch is provided by the embedded IMatch WebService. IMatch only provides application-specific functionality on top of that.
Title: Re: Initiating a rescan of a folder via scripting
Post by: ben on July 26, 2017, 08:19:24 PM
+1 for an endpoint "rescan iMatch folder"
Title: Re: Initiating a rescan of a folder via scripting
Post by: Mario on July 26, 2017, 09:01:37 PM
See my reply here:

https://www.photools.com/community/index.php?topic=6963.new#new

Important points!
Title: Re: Initiating a rescan of a folder via scripting
Post by: JohnZeman on July 26, 2017, 10:26:09 PM
I'm a total novice with JavaScript at this point in time so you might already know this but here is how I'm going to and rescanning a folder.

<input id="buttonrescan" type="submit" onclick="myFunction();" value="Go to !Queue and Rescan it">

// RESCAN !QUEUE ///////////////////////////////////////////////
document.getElementById('buttonrescan').onclick = function() {
// Select the !Queue Folder
     IMatch.gotoFolder(91,0).then(function(response) {
      IMatch.focusWindow('filewindow.active');
      IMatch.commandExecute('ID_CMD_FOLDER_SCANFOLDER');
     });
};
Title: Re: Initiating a rescan of a folder via scripting
Post by: ubacher on July 27, 2017, 07:45:17 AM
I too managed to get this going some - I think I reported it.

IMatch.focusWindow('mediafolders.tree').then(function (response) {
               
                IMatch.commandExecute('ID_CMD_FOLDER_SCANFOLDER');
                IMatch.modalClose()
            })


But this does not solve the problem of moves/copies and renames via scripting which don't
add the result to Imatch. Mario is working on this (I think/hope - since its my holdup now for using IM 2017)