Fix double hyphen causing Year issue. Ensure space removal is done at the right point. Add a source description of where the year came from.

This commit is contained in:
Hyperling 2025-04-13 10:59:36 -07:00
parent 3ac99d17d3
commit a513995ad9

View File

@ -173,9 +173,7 @@ function migrate_music {
year="${year// : /}"
year="${year//[^[:alnum:][:space:].]/}"
year="`echo $year`"
while [[ "$year" == *" "* ]]; do
year="${year// / }"
done
year_source="Year"
if [[ -z $year ]]; then
year=""
year="`exiftool -RecordingTime "$file"`"
@ -183,16 +181,21 @@ function migrate_music {
year="${year// : /}"
year="${year//[^[:alnum:][:space:].]/}"
year="`echo $year`"
year_source="RecordingTime"
fi
if [[ -z $year ]]; then
year=""
year="`exiftool --DateTimeOriginal "$file"`"
year="`exiftool -DateTimeOriginal "$file"`"
year="${year//Date\/Time Original /}"
year="${year// : /}"
year="${year//[^[:alnum:][:space:].]/}"
year="`echo $year`"
year_source="DateTimeOriginal"
fi
echo "*** Year=$year"
while [[ "$year" == *" "* ]]; do
year="${year// / }"
done
echo "*** Year=$year ($year_source)"
parent=""
if [[ -n $year && -n $album ]]; then