Skip to content

Commit bf27fdf

Browse files
committed
Adapt to en and cs Month names. The format of subfolders from Photo seems pretty unstable.
1 parent 5b99f5a commit bf27fdf

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

photos-rename-export-dirs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,31 @@ my %months = (
1818
'October' => 10,
1919
'November' => 11,
2020
'December' => 12,
21+
'ledna' => 1,
22+
'února' => 2,
23+
'března' => 3,
24+
'dubna' => 4,
25+
'května' => 5,
26+
'června' => 6,
27+
'července' => 7,
28+
'srpna' => 8,
29+
'září' => 9,
30+
'října' => 10,
31+
'listopadu' => 11,
32+
'prosince' => 12,
2133
);
2234

2335
my @DIRS = sort grep { chop; /.{2,}/ } `gfind -type d`;
2436

2537
for my $dir (@DIRS) {
2638

27-
if ($dir !~ /((?<name>.*), )?(?<day>\d+) (?<month>\w+) (?<year>\d+)/) {
39+
if ($dir =~ /((?<name>.*), )?(?<day>\d+) (?<month>\w+) (?<year>\d+)/) {
40+
41+
}
42+
elsif ( $dir =~ /((?<name>.*), )?(?<day>\d+)\. (?<month>\w+) (?<year>\d+)/ ) {
43+
44+
}
45+
else {
2846
print STDERR "-W|Directory '$dir' not matching export format from Apple Photos!\n";
2947
next;
3048
}

0 commit comments

Comments
 (0)