From: Mark Wooding Date: Fri, 7 Jun 2024 22:22:15 +0000 (+0100) Subject: track-boxing-progress: Script I used to track the boxing job. X-Git-Url: https://git.distorted.org.uk/~mdw/dvddb/commitdiff_plain/refs/heads/master?hp=a9c6964f5532a2b32033580fe0e0db5cc3fff285 track-boxing-progress: Script I used to track the boxing job. --- diff --git a/cycle b/cycle index 6f4a177..3006edc 100755 --- a/cycle +++ b/cycle @@ -2,5 +2,5 @@ ./update PATHS ./report >PATHS.new -if cmp -s PATHS.new PATHS; then rm PATHS.new +if diff -u PATHS PATHS.new; then rm PATHS.new else mv PATHS.new PATHS; fi diff --git a/report b/report index f8d0326..9f2bc11 100755 --- a/report +++ b/report @@ -85,11 +85,6 @@ for my $name (sort { my $pa = $set_path{$a}[0]; my $ba = $box{$pa} // "~~~"; my $paths = $set_path{$name}; my @unk; set_box $box{$paths->[0]}; - while (@iso && $iso[0] lt $paths->[0]) { push @unk, shift @iso; } - if (@unk) { - print "[#UNK: *]\n"; - for my $path (@unk) { print "\t", $path, "\n"; } - } printf "[#%d: %d] %s\n", $set_id{$name}, scalar @$paths, $name; my $i = 0; for my $path (@$paths) { diff --git a/track-boxing-progress b/track-boxing-progress new file mode 100755 index 0000000..2ffcbb6 --- /dev/null +++ b/track-boxing-progress @@ -0,0 +1,14 @@ +#! /bin/sh -e + +set -- $(psql -At -F" " -hroadstar -c ' + SELECT * FROM + (SELECT COUNT(*) FROM dvd_disc) AS ndisc, + (SELECT COUNT(*) FROM dvd_disc WHERE box IS NOT NULL) AS nboxed, + (SELECT COUNT(*) FROM + (SELECT DISTINCT box FROM dvd_disc + WHERE box IS NOT NULL) AS q) + AS nbox; +'); ndisc=$1 nboxed=$2 nbox=$3 + +echo "DONE $nboxed/$ndisc = $(( (100*$nboxed + $ndisc/2)/$ndisc ))%" +echo "BOXES $nbox + $(( (($ndisc - $nboxed)*$nbox + $nboxed - 1)/$nboxed ))" \ No newline at end of file