From f20ce0f7a492abce6394957a5afc54e30e7edb7c Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sun, 21 Mar 2021 16:58:06 +1100 Subject: [PATCH] removed old code, commented out Dump() debug --- files.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/files.py b/files.py index 69b032f..29b080e 100644 --- a/files.py +++ b/files.py @@ -234,34 +234,6 @@ def scan_sp(): return render_template("base.html") -def TrimmedPath( prefix, path ): - return path.replace(prefix, '' ) - -def AddDup( prefix, row, dups ): - if row.hash not in dups: - dups[row.hash]=[] - dups[row.hash].append( { 'f': row.fname1, 'd':TrimmedPath(prefix, row.path1), 'did': row.did1, 'h':row.hash, 'id':row.id1 } ) - dups[row.hash].append( { 'f': row.fname2, 'd':TrimmedPath(prefix, row.path2), 'did': row.did2, 'h':row.hash, 'id':row.id2 } ) - else: - # process path1 / fname1 -- if that combo is not in the dups[hash], add it - found=0 - for dup in dups[row.hash]: - if dup['f'] == row.fname1 and dup['d'] == TrimmedPath(prefix, row.path1): - found=1 - continue - if not found: - dups[row.hash].append( { 'f': row.fname1, 'd':TrimmedPath(prefix, row.path1), 'did': row.did1, 'h':row.hash, 'id':row.id1 } ) - - # process path2 / fname2 -- if that combo is not in the dups[hash], add it - found=0 - for dup in dups[row.hash]: - if dup['f'] == row.fname2 and dup['d'] == TrimmedPath(prefix, row.path2): - found=1 - continue - if not found: - dups[row.hash].append( { 'f': row.fname2, 'd':TrimmedPath(prefix, row.path2), 'did': row.did2, 'h':row.hash, 'id':row.id2 } ) - return - @app.route("/fix_dups", methods=["POST"]) def fix_dups(): rows = db.engine.execute( "select e1.id as id1, f1.hash, d1.path_prefix as path1, d1.eid as did1, e1.name as fname1, e2.id as id2, d2.path_prefix as path2, d2.eid as did2, e2.name as fname2 from entry e1, file f1, dir d1, entry_dir_link edl1, entry e2, file f2, dir d2, entry_dir_link edl2 where e1.id = f1.eid and e2.id = f2.eid and d1.eid = edl1.dir_eid and edl1.entry_id = e1.id and edl2.dir_eid = d2.eid and edl2.entry_id = e2.id and f1.hash = f2.hash and e1.id != e2.id and f1.size_mb = f2.size_mb order by path1, fname1" ) @@ -283,7 +255,7 @@ def fix_dups(): DD.AddDup( row ) DD.SecondPass() - print( DD.Dump() ) +# DD.Dump() return render_template("dups.html", DD=DD, fe_msg_id=request.form['fe_msg_id'], pagesize=pagesize )