track-boxing-progress: Script I used to track the boxing job. master
authorMark Wooding <mdw@distorted.org.uk>
Fri, 7 Jun 2024 22:22:15 +0000 (23:22 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 7 Jun 2024 22:22:15 +0000 (23:22 +0100)
cycle
report
track-boxing-progress [new file with mode: 0755]

diff --git a/cycle b/cycle
index 6f4a177..3006edc 100755 (executable)
--- 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 (executable)
--- 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 (executable)
index 0000000..2ffcbb6
--- /dev/null
@@ -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