Skip to content

Commit 9ffe94d

Browse files
committed
Enhanced text output during extraction
When extracting, the tool will now display the name of the internal "DCIM" folder where the media file was originally located in the backup/filesystem. Discussed and proposed in [#12](#12 (comment))
1 parent 3a99610 commit 9ffe94d

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/ios_backup_extractor.pl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ sub extractMediaFiles
434434
qq{\t$DBI::errstr.\n};
435435
436436
my $file_index = 1;
437+
my $media_location = q{};
438+
my $media_subdir = q{};
437439
438440
# filter all full-size JPG, HEIC... images
439441
while (my $row = $sth->fetchrow_hashref)
@@ -446,14 +448,18 @@ sub extractMediaFiles
446448
&& $relative_path =~ /\.$wanted_extensions$/i);
447449
448450
# determine filename
449-
unless ($relative_path =~ m{^ .+
450-
/DCIM
451-
/\d+APPLE
452-
/(?<filename>[^./]+)(?:\.|/)
451+
unless ($relative_path =~ m{^
452+
(?<media_location>
453+
.+
454+
/DCIM/)
455+
(?<media_subdir>
456+
\d+APPLE/)
457+
(?<filename>
458+
[^./]+)
459+
(?:\.|/)
453460
.*
454461
(?<extension>
455-
(?i:$wanted_extensions)
456-
)
462+
(?i:$wanted_extensions))
457463
$
458464
}x)
459465
{
@@ -464,6 +470,12 @@ sub extractMediaFiles
464470
next;
465471
}
466472
473+
if ($media_location ne $+{media_location} || $media_subdir ne $+{media_subdir})
474+
{
475+
($media_location, $media_subdir) = ($+{media_location}, $+{media_subdir});
476+
say STDERR " ╭────┤Extracting from: [${media_location}$media_subdir]";
477+
}
478+
467479
# add '_DELETED' flag to files marked as deleted
468480
my $deleted_flag = ($cmd_options{'add-trash'} && $g_deleted_files{$relative_path})
469481
? '_DELETED'

0 commit comments

Comments
 (0)