mirror of
https://github.com/Jonny007-MKD/OTR-SaneRename
synced 2025-01-22 08:49:48 +01:00
Link EPG in main dir to testing dir. This way we can use old files
This commit is contained in:
parent
1990ced50c
commit
57e65b53e8
3 changed files with 4362 additions and 11 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
|||
epg-*
|
||||
/epg-*
|
||||
episodes-*
|
||||
*.cache
|
||||
log
|
||||
|
|
4331
testing/epg-15.03.07.csv
Normal file
4331
testing/epg-15.03.07.csv
Normal file
File diff suppressed because it is too large
Load diff
|
@ -9,19 +9,39 @@ files=(
|
|||
);
|
||||
|
||||
if [ -f test.sh ]; then
|
||||
sr="../saneRenamix.sh"
|
||||
path=".."
|
||||
else
|
||||
sr="./saneRenamix.sh"
|
||||
path="."
|
||||
fi
|
||||
|
||||
if [ ! -f "$path/saneRenamix.sh" ]; then
|
||||
echo "saneRenamix.sh not found!" >&2
|
||||
fi
|
||||
|
||||
|
||||
i=0
|
||||
for file in "${!files[@]}"; do
|
||||
echo -e "\033[37m${file}";
|
||||
result="$($sr $srArgs -s -f "$file")";
|
||||
if [ "$result" != "${files["$file"]}" ]; then
|
||||
echo -e "\033[31m$file -> $result";
|
||||
echo "'$result' != '${files[$file]}'";
|
||||
for the_file in "${!files[@]}"; do
|
||||
echo -e "\033[37m${the_file}";
|
||||
|
||||
file="${the_file//_/ }"
|
||||
|
||||
file_title=${file%% [0-9][0-9].*} # Cut off everything after the title: date, hour, sender, ...
|
||||
file_sender=${file##*-[0-9][0-9]} # Cut off everything bevor the sender: title, date, time, ...
|
||||
|
||||
file_date=${file%%$file_sender} # Cut off the sender
|
||||
file_date=${file_date##$file_title } # Cut off the title, now we do have the date and time
|
||||
file_time=${file_date##* }
|
||||
file_date=${file_date%% *}
|
||||
|
||||
epg_file="epg-$file_date.csv"
|
||||
|
||||
if ! [ -f $path/$epg_file ]; then # Create EPG file if neccessary
|
||||
ln -s "testing/$epg_file" "$path/$epg_file"
|
||||
fi
|
||||
|
||||
result="$($path/saneRenamix.sh $srArgs -s -f "$the_file")";
|
||||
|
||||
if [ "$result" != "${files["$the_file"]}" ]; then
|
||||
echo -e "\033[31m$the_file -> $result";
|
||||
echo "'$result' != '${files[$the_file]}'";
|
||||
fi
|
||||
i=$(($i+1));
|
||||
done;
|
||||
|
|
Loading…
Reference in a new issue