wip migrating scripts
This commit is contained in:
parent
2c0a76d58a
commit
35397427d7
7
defase_draws.sh
Executable file
7
defase_draws.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/etc/profiles/per-user/jawz/bin/bash
|
||||
|
||||
cd /home/jawz/Development/Websites/portfolio/content/ijwbs || exit
|
||||
|
||||
for file in [0-9][0-9][0-9]_*; do
|
||||
mv "$file" "$(printf '%03d_%s' $((10#${file%%_*} + 4)) "${file#*_}")"
|
||||
done
|
||||
35
missingmanga.fish
Executable file
35
missingmanga.fish
Executable file
@ -0,0 +1,35 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i fish -p fish
|
||||
|
||||
set root_directories /srv/server/pool/multimedia/media/Library/comics \
|
||||
/srv/server/pool/multimedia/media/Library/manga/manga \
|
||||
/srv/server/pool/multimedia/media/Library/webtoons
|
||||
set blacklist 'NOBLESSE|Air Gear'
|
||||
for root_dir in $root_directories
|
||||
for dir in (find $root_dir -mindepth 1 -type d)
|
||||
cd $dir
|
||||
fd -q -tfile $blacklist
|
||||
if test $status -eq 0
|
||||
continue
|
||||
end
|
||||
fd -q -tfile '((\d+|\d+\.\d+)(\.cbz|\.pdf))$'
|
||||
if test $status -eq 1
|
||||
continue
|
||||
end
|
||||
set max_chapter (find -not -name '*Annual*' -print0 | string match -ar '(\d+|\d+\.\d+)(?=\.cbz|\.pdf)' | sort -h | tail -n 1)
|
||||
set min_chapter (find -not -name '*Vol.*' -not -name '*TPB*' -print0 |
|
||||
string match -ar '(\d+|\d+\.\d+)(?=\.cbz|\.pdf)' |
|
||||
sort -h |
|
||||
head -n 1)
|
||||
set ext (fd . | string match -r '(\.cbz|\.pdf)' | tail -n 1)
|
||||
set base_name (fd . | string match -r '(.*(?<!Annual )(#|Vol\.|Ch\.))(?=(\d+|\d+\.\d+)(\.cbz|\.pdf))' | head -n 1)
|
||||
for i in (seq $min_chapter $max_chapter)
|
||||
set theorical_file (echo $base_name$i$ext)
|
||||
if test -e $theorical_file
|
||||
continue
|
||||
end
|
||||
pwd
|
||||
echo $theorical_file
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user