Main Menu

Recent posts

#31
OK, thanks Mario - I see them now...
#32
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by Mario - July 22, 2024, 07:48:54 PM
Fix the non-escaped . and it will work. See my post.
the endpoint searches the entire path so I'm sure it will work if you get your regexp right. Escape the . (issue 2) and don't add an extra . after the extension (issue 1). See my posts above.
#33
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by RobiWan - July 22, 2024, 07:34:19 PM
Quote from: David_H on July 22, 2024, 07:23:06 PMBecause you are asking it to search on the filename. ExtHDD is in the PATH, not the filename (rr52024.cr3).

Hmm, ExtHDD is a part of filename I mean.

id                 : 226011
ts                 : 45489,823727
tsmd               : 0,000000
tsCreated          : 2023:10:01T10:22:57.458
tsLastModified     : 2023:09:26T09:24:26.0
tsLastWriteBackUtc : 0,000000
tsLastWriteBack    : 0,000000
index              : 59
folderId           : 1719
folder             : C:\DSLR\DSLR-RAW\ExtHDD 2508\EOS R5\2023\09\26\
name               : _rr52024.cr3
namene             : _rr52024
ext                : .cr3
fileName           : C:\DSLR\DSLR-RAW\ExtHDD 2508\EOS R5\2023\09\26\_rr52024.cr3
size               : 53712982
crc                : 2044429776
ltid               : 3E26B778-AA74-44B1-B3FF-59E58E0D453D
class              : image
format             : CRW
mimeType           : text/plain
lastUpdated        : 2023-09-26T11:24:26
lastUpdatedUTC     : 2023-09-26T09:24:26
dateTime           : 2023-09-26T11:24:25
dateTimeUTC        : 2023-09-26T09:24:25
dateTimeOriginal   : 2023-09-26T11:24:25
dateTimeLocal      : 2023-09-26T11:24:25
dateTimeOffset     : 120
offline            : False
protected          : False
readOnly           : False
pending            : False
pendingWb          : False
width              : 8352
height             : 5586
longEdge           : 8352
shortEdge          : 5586
portrait           : False
bpp                : 24
rating             : 2
label              :
stackState         : 0
stackId            : 0
stackColor         :
versionState       : 0
history            : {@{event=}, @{event=}}
gps                : @{lat=54,188267; lon=7,883228; alt=38,620000}
collections        : {13, 34, 54, 10002...}
roi                : @{v=False; t=0,000000; r=1,000000; b=1,000000; l=0,000000}
#34
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by David_H - July 22, 2024, 07:23:06 PM
Quote from: RobiWan on July 22, 2024, 06:43:23 PMOk understand.

let me ask a different question. Why the first one doesn't work and the second one works?


PowerShell  > (Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=ExtHDD").content

{"files":[],"hiddenByStacks":0}


PowerShell  > (Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=_rr52024.cr3").content
{"files":[{"id":216011,"ts":45489.813102,"tsmd":0.000000,"tsCreated":"2023:05:04T10:21:38.193","tsLastModified":"2023:05:04T06:00:04.0","tsLastWriteBackUtc":0.000000,"tsLastWriteBack":0.000000,"index":0,"folderId":1714,"folder":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\05\\04\\","name":"_rr52024.cr3","namene":"_rr52024","ext":".cr3","fileName":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\05\\04\\_rr52024.cr3","size":53537366,"crc":3658268326,"ltid":"2A45C54B-1E54-4A2B-A7B6-D3B78BDE3A15","class":"image","format":"CRW","mimeType":"text/plain","lastUpdated":"2023-05-04T08:00:04","lastUpdatedUTC":"2023-05-04T06:00:04","dateTime":"2023-05-04T08:00:03","dateTimeUTC":"2023-05-04T06:00:03","dateTimeOriginal":"2023-05-04T08:00:03","dateTimeLocal":"2023-05-04T08:00:03","dateTimeOffset":120,"offline":false,"protected":false,"readOnly":false,"pending":false,"pendingWb":false,"width":8352,"height":5586,"longEdge":8352,"shortEdge":5586,"portrait":false,"bpp":24,"rating":2,"label":"","stackState":0,"stackId":0,"stackColor":"","versionState":0,"history":[{"event":{"type":1,"name":"added","id":216011,"id2":0,"dateTime":"2023-11-11T10:07:30","title":"","text":"","user":"robert"}},{"event":{"type":2,"name":"updated","id":216011,"id2":0,"dateTime":"2023-11-11T11:14:12","title":"","text":"","user":"robert"}}],"gps":{"lat":39.862600,"lon":-5.023578,"alt":408.300000},"collections":[13,34,54,10002,11001],"roi":{"v":false,"t":0.000000,"r":1.000000,"b":1.000000,"l":0.000000}},{"id":226011,"ts":45489.823727,"tsmd":0.000000,"tsCreated":"2023:10:01T10:22:57.458","tsLastModified":"2023:09:26T09:24:26.0","tsLastWriteBackUtc":0.000000,"tsLastWriteBack":0.000000,"index":1,"folderId":1719,"folder":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\09\\26\\","name":"_rr52024.cr3","namene":"_rr52024","ext":".cr3","fileName":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\09\\26\\_rr52024.cr3","size":53712982,"crc":2044429776,"ltid":"3E26B778-AA74-44B1-B3FF-59E58E0D453D","class":"image","format":"CRW","mimeType":"text/plain","lastUpdated":"2023-09-26T11:24:26","lastUpdatedUTC":"2023-09-26T09:24:26","dateTime":"2023-09-26T11:24:25","dateTimeUTC":"2023-09-26T09:24:25","dateTimeOriginal":"2023-09-26T11:24:25","dateTimeLocal":"2023-09-26T11:24:25","dateTimeOffset":120,"offline":false,"protected":false,"readOnly":false,"pending":false,"pendingWb":false,"width":8352,"height":5586,"longEdge":8352,"shortEdge":5586,"portrait":false,"bpp":24,"rating":2,"label":"","stackState":0,"stackId":0,"stackColor":"","versionState":0,"history":[{"event":{"type":1,"name":"added","id":226011,"id2":0,"dateTime":"2023-11-11T10:13:46","title":"","text":"","user":"robert"}},{"event":{"type":2,"name":"updated","id":226011,"id2":0,"dateTime":"2023-11-11T12:34:20","title":"","text":"","user":"robert"}}],"gps":{"lat":54.188267,"lon":7.883228,"alt":38.620000},"collections":[13,34,54,10002,11001],"roi":{"v":false,"t":0.000000,"r":1.000000,"b":1.000000,"l":0.000000}}],"hiddenByStacks":0}


"ExtHDD" is a part of path where many images are stored, so I think I should receive many results back.
I did not say that the API does not work. At the moment I'm trying to get an overview of the whole thing.



Because you are asking it to search on the filename. ExtHDD is in the PATH, not the filename (rr52024.cr3).

Try the v1/folders endpoint ($URI/v1/folders?auth_token=&contains=ExtHDD ) instead.
#35
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by Mario - July 22, 2024, 07:02:56 PM
Again, regexp.

pattern=ExtHDD  => Find all files containing ExtHDD

pattern=_rr52024.cr3 => The . must be escaped to make it work => pattern=_rr52024\.cr3
#36
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by RobiWan - July 22, 2024, 06:43:23 PM
Ok understand.

let me ask a different question. Why the first one doesn't work and the second one works?


PowerShell  > (Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=ExtHDD").content

{"files":[],"hiddenByStacks":0}


PowerShell  > (Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=_rr52024.cr3").content
{"files":[{"id":216011,"ts":45489.813102,"tsmd":0.000000,"tsCreated":"2023:05:04T10:21:38.193","tsLastModified":"2023:05:04T06:00:04.0","tsLastWriteBackUtc":0.000000,"tsLastWriteBack":0.000000,"index":0,"folderId":1714,"folder":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\05\\04\\","name":"_rr52024.cr3","namene":"_rr52024","ext":".cr3","fileName":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\05\\04\\_rr52024.cr3","size":53537366,"crc":3658268326,"ltid":"2A45C54B-1E54-4A2B-A7B6-D3B78BDE3A15","class":"image","format":"CRW","mimeType":"text/plain","lastUpdated":"2023-05-04T08:00:04","lastUpdatedUTC":"2023-05-04T06:00:04","dateTime":"2023-05-04T08:00:03","dateTimeUTC":"2023-05-04T06:00:03","dateTimeOriginal":"2023-05-04T08:00:03","dateTimeLocal":"2023-05-04T08:00:03","dateTimeOffset":120,"offline":false,"protected":false,"readOnly":false,"pending":false,"pendingWb":false,"width":8352,"height":5586,"longEdge":8352,"shortEdge":5586,"portrait":false,"bpp":24,"rating":2,"label":"","stackState":0,"stackId":0,"stackColor":"","versionState":0,"history":[{"event":{"type":1,"name":"added","id":216011,"id2":0,"dateTime":"2023-11-11T10:07:30","title":"","text":"","user":"robert"}},{"event":{"type":2,"name":"updated","id":216011,"id2":0,"dateTime":"2023-11-11T11:14:12","title":"","text":"","user":"robert"}}],"gps":{"lat":39.862600,"lon":-5.023578,"alt":408.300000},"collections":[13,34,54,10002,11001],"roi":{"v":false,"t":0.000000,"r":1.000000,"b":1.000000,"l":0.000000}},{"id":226011,"ts":45489.823727,"tsmd":0.000000,"tsCreated":"2023:10:01T10:22:57.458","tsLastModified":"2023:09:26T09:24:26.0","tsLastWriteBackUtc":0.000000,"tsLastWriteBack":0.000000,"index":1,"folderId":1719,"folder":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\09\\26\\","name":"_rr52024.cr3","namene":"_rr52024","ext":".cr3","fileName":"C:\\DSLR\\DSLR-RAW\\ExtHDD 2508\\EOS R5\\2023\\09\\26\\_rr52024.cr3","size":53712982,"crc":2044429776,"ltid":"3E26B778-AA74-44B1-B3FF-59E58E0D453D","class":"image","format":"CRW","mimeType":"text/plain","lastUpdated":"2023-09-26T11:24:26","lastUpdatedUTC":"2023-09-26T09:24:26","dateTime":"2023-09-26T11:24:25","dateTimeUTC":"2023-09-26T09:24:25","dateTimeOriginal":"2023-09-26T11:24:25","dateTimeLocal":"2023-09-26T11:24:25","dateTimeOffset":120,"offline":false,"protected":false,"readOnly":false,"pending":false,"pendingWb":false,"width":8352,"height":5586,"longEdge":8352,"shortEdge":5586,"portrait":false,"bpp":24,"rating":2,"label":"","stackState":0,"stackId":0,"stackColor":"","versionState":0,"history":[{"event":{"type":1,"name":"added","id":226011,"id2":0,"dateTime":"2023-11-11T10:13:46","title":"","text":"","user":"robert"}},{"event":{"type":2,"name":"updated","id":226011,"id2":0,"dateTime":"2023-11-11T12:34:20","title":"","text":"","user":"robert"}}],"gps":{"lat":54.188267,"lon":7.883228,"alt":38.620000},"collections":[13,34,54,10002,11001],"roi":{"v":false,"t":0.000000,"r":1.000000,"b":1.000000,"l":0.000000}}],"hiddenByStacks":0}


"ExtHDD" is a part of path where many images are stored, so I think I should receive many results back.
I did not say that the API does not work. At the moment I'm trying to get an overview of the whole thing.

#37
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by Mario - July 22, 2024, 04:55:37 PM
I'm no PowerShell expert, sorry. And I don't have the resources to debug user-written scripts.
If things work in the File Finder app, the API is OK. Same endpoint.

You're sure about this:?

^$strImageName\.
When the variable holds ""pict0980.mrw" you're sending this regexp, right?

^pict0980.mrw\.

This cannot work.
#38
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by RobiWan - July 22, 2024, 03:39:18 PM
I thing we're talking past each other

Works
$strImageName = "pict0980"
$arrImageParts = ((Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=^$strImageName\.&sortby=filename-Asc").Content | convertfrom-json).files

Not working
$strImageName = "pict0980.mrw"
$arrImageParts = ((Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=^$strImageName\.&sortby=filename-Asc").Content | convertfrom-json).files

Not working
$strImageName = "pict0980\.mrw"
$arrImageParts = ((Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=^$strImageName\.&sortby=filename-Asc").Content | convertfrom-json).files

Not working

$strImageName = "C:\\DSLR\\DSLR-RAW\\ExtHDD\ 2501\\Dynax7D\\2006\\09\\17\\pict0980\.mrw"
$arrImageParts = ((Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=^$strImageName\.&sortby=filename-Asc").Content | convertfrom-json).files

Not working
$strImageName = "C:\DSLR\DSLR-RAW\ExtHDD 2501\Dynax7D\2006\09\17\pict0980.mrw"
$arrImageParts = ((Invoke-WebRequest -Uri "$URI/v1/search/filename?auth_token=&scope=database&pattern=^$strImageName\.&sortby=filename-Asc").Content | convertfrom-json).files

The above script was created from this one.
#39
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by Mario - July 22, 2024, 02:35:08 PM
This is a regular expression. Keep the special meaning of characters like \ in mind wne you include the path in the pattern. See Escaping
#40
IMatch Scripting and Apps / Re: Whats wrong with my PS1 Sc...
Last post by RobiWan - July 22, 2024, 02:01:09 PM
Is it possible that it can only work if only filename ( $strImageName ) without path is passed?