]> git.phdru.name Git - bookmarks_db.git/commitdiff
Feat: Improve stats
authorOleg Broytman <phd@phdru.name>
Tue, 14 Nov 2023 18:01:59 +0000 (21:01 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 14 Nov 2023 18:03:07 +0000 (21:03 +0300)
check_redirects.py
check_title.py

index c9161d9016a7d1318e823e9cac4b8322aa47e52e..ef7a505c733de11197a7557ad2137cfe652d9181 100755 (executable)
@@ -64,6 +64,7 @@ def run():
     if report_stats:
         print("Ok")
 
+    redirects = 0
     for object_no in range(objects):
         object = root_folder.linear[object_no]
 
@@ -75,9 +76,11 @@ def run():
             if hasattr(object, "moved"):
                 report_redirect(object.href, object.moved)
                 del object.moved
+                redirects += 1
 
     if report_stats:
         print(objects, "objects passed")
+        print(redirects, "redirects")
 
 
 if __name__ == '__main__':
index 391f5a147ec5882fbb3541604f9b741a3670377b..0bb10602281defb9bd127ae91f9fdf8d8ab019a0 100755 (executable)
@@ -68,6 +68,7 @@ def run():
     if report_stats:
         print("Ok")
 
+    changed_titles = no_titles = 0
     for object_no in range(objects):
         object = root_folder.linear[object_no]
 
@@ -82,11 +83,15 @@ def run():
                 unquoted_name = unquote_title(object.name)
                 if unquoted_name != unquoted_title:
                     report_title(object.href, unquoted_name, unquoted_title)
+                    changed_titles += 1
             else:
                 report_title(object.href, object.name, None)
+                no_titles += 1
 
     if report_stats:
         print(objects, "objects passed")
+        print(changed_titles, "changed titles")
+        print(no_titles, "no titles")
 
 
 if __name__ == '__main__':