]> git.plutz.net Git - serve0/commitdiff
bugifx: autogroup present but empty group fields
authorPaul Hänsch <paul@plutz.net>
Tue, 21 Dec 2021 23:39:21 +0000 (00:39 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 21 Dec 2021 23:39:21 +0000 (00:39 +0100)
db_meta.sh

index 9dfbe4c2460a422a23ac1a956a1d0839b4ce3579..588e62d30b677fc1d3318bdba44d0ca24e6c12f3 100755 (executable)
@@ -166,21 +166,20 @@ list_meta(){
 
 dbmeta_autogroup(){
   sed -E '
+    # strip empty group field
+    s;\r       \\$;\r;;
     h;  # save original dataset
 
     # strip common suffixes of web video sites
     s;-([0-9a-zA-Z_-]{11}|ph[0-9a-f]{13}|xh[0-9a-zA-Z]{5}|[0-9]{6,})\r;-\r;;
 
-    # clear branching status
-    tBRANCH; :BRANCH
-
     # perform auto grouping if group id is missing or empty
-    /\r$/bAUTOGROUP; s;\r      \\$;\r;; tAUTOGROUP;
+    /\r$/bAUTOGROUP;
   
     # only perform ordering if manual group id is present
     /\r        .+$/bAUTOORDER;
 
-    b;
+    b;  # pass invalid records without processing
 
     :AUTOORDER
     # strip all fields but the name