@@ -60,6 +60,9 @@ Database path for preference data files.
6060Don't use alternative settings stored in session for AI preferences like
6161Language, Image collections, etc.
6262
63+ . PARAMETER FullScreen
64+ Open in fullscreen mode.
65+
6366. PARAMETER ShowWindow
6467Show LM Studio window during initialization.
6568
@@ -319,6 +322,13 @@ function Export-ImageIndex {
319322 [Alias (' FromPreferences' )]
320323 [switch ] $SkipSession ,
321324 # ##############################################################################
325+ [Parameter (
326+ Mandatory = $false ,
327+ HelpMessage = ' Opens in fullscreen mode'
328+ )]
329+ [Alias (' fs' , ' f' )]
330+ [switch ] $FullScreen ,
331+ # ##############################################################################
322332 [Parameter (
323333 Mandatory = $false ,
324334 HelpMessage = (' Show LM Studio window during ' +
@@ -568,6 +578,15 @@ function Export-ImageIndex {
568578
569579 $ImageDirectories = GenXdev.AI\Get-AIImageCollection @params
570580
581+ # copy identical parameter values for Find-Image function call
582+ $findImageParams = GenXdev.Helpers\Copy-IdenticalParamValues `
583+ - BoundParameters $PSBoundParameters `
584+ - FunctionName ' GenXdev.AI\Find-Image' `
585+ - DefaultValues (
586+ Microsoft.PowerShell.Utility\Get-Variable - Scope Local `
587+ - ErrorAction SilentlyContinue
588+ )
589+
571590 # output that the image index database is being recreated
572591 Microsoft.PowerShell.Utility\Write-Host (
573592 " Recreating image index database`r`n " +
@@ -598,7 +617,7 @@ function Export-ImageIndex {
598617 }
599618
600619 # define schema version constant
601- $SCHEMA_VERSION = ' 1.0.0.5 '
620+ $SCHEMA_VERSION = ' 1.0.0.6 '
602621
603622 # initialize info object for tracking found results
604623 $Info = @ {
@@ -638,7 +657,17 @@ function Export-ImageIndex {
638657 ) - CreateDirectory - DeleteExistingFile - ErrorAction SilentlyContinue
639658
640659 # define backup file path for database
641- $DatabaseBackupFilePath = GenXdev.FileSystem\Expand-Path " ${DatabaseFilePath} .backup.db" - DeleteExistingFile - CreateDirectory
660+ $DatabaseBackupFilePath = " " ;
661+ $idx = 0 ;
662+ while ($true ) {
663+ try {
664+ $DatabaseBackupFilePath = GenXdev.FileSystem\Expand-Path " ${DatabaseFilePath} .backup.$ ( ($idx -gt 0 ? ' .$idx' : ' ' )) db" - DeleteExistingFile - CreateDirectory
665+ break ;
666+ }
667+ catch {
668+ $idx ++ ;
669+ }
670+ }
642671
643672 # check if the database file exists after expansion and handle backup
644673 if ([IO.File ]::Exists($DatabaseFilePath )) {
@@ -732,7 +761,6 @@ CREATE TABLE IF NOT EXISTS Images (
732761 scene_label TEXT,
733762 scene_confidence REAL,
734763 scene_confidence_percentage REAL,
735- scene_processed_at DATETIME,
736764
737765 -- Camera metadata
738766 camera_make TEXT,
@@ -1005,13 +1033,13 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
10051033 $totalTime = [System.Diagnostics.Stopwatch ]::StartNew()
10061034
10071035 # always delete existing database file to ensure clean rebuild
1008- if (Microsoft.PowerShell.Management\Test-Path $DatabaseFilePath ) {
1036+ if (Microsoft.PowerShell.Management\Test-Path - LiteralPath $DatabaseFilePath ) {
10091037
10101038 Microsoft.PowerShell.Utility\Write-Verbose (
10111039 ' Deleting existing database file for clean rebuild...'
10121040 )
10131041
1014- Microsoft.PowerShell.Management\Remove-Item $DatabaseFilePath - Force
1042+ Microsoft.PowerShell.Management\Remove-Item - LiteralPath $DatabaseFilePath - Force
10151043 }
10161044
10171045 # create new database using specialized function
@@ -1059,7 +1087,7 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
10591087 ' style_type, description_keywords, people_count, people_faces, ' +
10601088 ' people_json, objects_count, objects_list, objects_json, ' +
10611089 ' object_counts, scene_label, scene_confidence, ' +
1062- ' scene_confidence_percentage, scene_processed_at, camera_make, ' +
1090+ ' scene_confidence_percentage, camera_make, ' +
10631091 ' camera_model, software, gps_latitude, gps_longitude, ' +
10641092 ' gps_altitude, exposure_time, f_number, iso_speed, focal_length, ' +
10651093 ' flash, date_time_original, date_time_digitized, color_space, ' +
@@ -1070,7 +1098,7 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
10701098 ' @desc_keywords, @people_count, @people_faces, @people_json, ' +
10711099 ' @objects_count, @objects_list, @objects_json, @object_counts, ' +
10721100 ' @scene_label, @scene_confidence, @scene_conf_pct, ' +
1073- ' @scene_processed, @ camera_make, @camera_model, @software, ' +
1101+ ' @camera_make, @camera_model, @software, ' +
10741102 ' @gps_latitude, @gps_longitude, @gps_altitude, @exposure_time, ' +
10751103 ' @f_number, @iso_speed, @focal_length, @flash, ' +
10761104 ' @date_time_original, @date_time_digitized, @color_space, ' +
@@ -1085,7 +1113,7 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
10851113 ' people_count, people_faces, people_json, objects_count, ' +
10861114 ' objects_list, objects_json, object_counts, scene_label, ' +
10871115 ' scene_confidence, scene_confidence_percentage, ' +
1088- ' scene_processed_at, camera_make, camera_model, software, ' +
1116+ ' camera_make, camera_model, software, ' +
10891117 ' gps_latitude, gps_longitude, gps_altitude, exposure_time, ' +
10901118 ' f_number, iso_speed, focal_length, flash, date_time_original, ' +
10911119 ' date_time_digitized, color_space, bits_per_sample, artist, ' +
@@ -1095,7 +1123,7 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
10951123 ' @style, @desc_keywords, @people_count, @people_faces, ' +
10961124 ' @people_json, @objects_count, @objects_list, @objects_json, ' +
10971125 ' @object_counts, @scene_label, @scene_confidence, ' +
1098- ' @scene_conf_pct, @scene_processed, @ camera_make, @camera_model, ' +
1126+ ' @scene_conf_pct, @camera_make, @camera_model, ' +
10991127 ' @software, @gps_latitude, @gps_longitude, @gps_altitude, ' +
11001128 ' @exposure_time, @f_number, @iso_speed, @focal_length, @flash, ' +
11011129 ' @date_time_original, @date_time_digitized, @color_space, ' +
@@ -1111,26 +1139,6 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
11111139 $Info.FoundResults = $true
11121140
11131141
1114- # set image directories for Find-Image from configured sources
1115- $imageCollectionParams = GenXdev.Helpers\Copy-IdenticalParamValues `
1116- - BoundParameters $PSBoundParameters `
1117- - FunctionName ' GenXdev.AI\Get-AIImageCollection' `
1118- - DefaultValues (
1119- Microsoft.PowerShell.Utility\Get-Variable - Scope Local `
1120- - ErrorAction SilentlyContinue
1121- )
1122-
1123- # copy identical parameter values for Find-Image function call
1124- $findImageParams = GenXdev.Helpers\Copy-IdenticalParamValues `
1125- - BoundParameters $PSBoundParameters `
1126- - FunctionName ' GenXdev.AI\Find-Image' `
1127- - DefaultValues (
1128- Microsoft.PowerShell.Utility\Get-Variable - Scope Local `
1129- - ErrorAction SilentlyContinue
1130- )
1131-
1132- $findImageParams.ImageDirectories = `
1133- GenXdev.AI\Get-AIImageCollection @imageCollectionParams
11341142
11351143 # prepare lookup table inserts using strongly typed collections
11361144 [System.Collections.Generic.List [String ]] $lookupQueries = `
@@ -1258,9 +1266,6 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
12581266 ' scene_conf_pct' = if ($image.scenes ) {
12591267 $image.scenes.confidence_percentage }
12601268 else { 0 }
1261- ' scene_processed' = if ($image.scenes ) {
1262- $image.scenes.processed_at }
1263- else { ' ' }
12641269
12651270 # Camera metadata
12661271 ' camera_make' = if ($image.metadata -and
@@ -1375,7 +1380,7 @@ CREATE INDEX IF NOT EXISTS idx_images_scene_confidence_range ON Images(scene_con
13751380
13761381 # check if image file exists before reading binary data
13771382 if (Microsoft.PowerShell.Management\Test-Path `
1378- $image.path - PathType Leaf) {
1383+ - LiteralPath $image.path - PathType Leaf) {
13791384
13801385 Microsoft.PowerShell.Utility\Write-Verbose (
13811386 " Reading image data from: $ ( $image.path ) "
0 commit comments