Cannot get job: Source and destination must not be the same error

Post Reply
freakpazo
Newbie
Posts: 9
Joined: Fri Nov 03, 2023 3:46 pm

Cannot get job: Source and destination must not be the same error

Post by freakpazo »

Hello

I have an array of jobs that I am manipulating trough the different stages of my script.
I am getting the filePath of a job with

Code: Select all

await job.get(AccessLevel.ReadWrite)
and then manipulating some of the xmp data with exiftool based on the path.
After that I am iterating trough the jobs again but when I try to get the filepath of a job with

Code: Select all

await job.get(AccessLevel.ReadWrite)
I am getting the following error

Code: Select all

Cannot get job: Source and destination must not be the same
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

Re: Cannot get job: Source and destination must not be the same error

Post by freddyp »

First of all I am not sure I understand what you are doing exactly. You have an array of jobs, so that must be as a result of getJobs() in timerFired, correct? But you are just doing something with XMP data so your script must be doing something with just a single job in jobArrived. That is contradictory.

That being said, in Node.js you can only "get" a job once and you can only "send" a job once. That is different compared to legacy scripting. There is no need to get a job path multiple times; once you have the path you have it. If you have multiple jobs you have to treat them as such: each job is a job in its own right.

That being said, if you want to update XMP data have you considered using the standard app "XMP inject"? It has an "Action - Update XMP".
freakpazo
Newbie
Posts: 9
Joined: Fri Nov 03, 2023 3:46 pm

Re: Cannot get job: Source and destination must not be the same error

Post by freakpazo »

1. Yes I am getting the jobs with getJobs() in timerFired. I am doing it there since I want to batch send information to a server.
2. I am iterating the jobs array multiple times in different parts of the script this is why storing the path seemed counterintuitive but it is a possible solution.
3. Modifying the xmp data is not the only purpose of the script. For modifying xmp data I am using third party library since the XMP data I have to read and write is using custom metadata schema - which I thought is not possible out of the box from what I read in the documentation
Post Reply