keep processing all dups, even when > pagesize, so that alert at end is definitive about automatic matches that will be deleted. Also, fixed issue where a duplicate in the root dir of an import / storage path, was showing as blank after TrimmedPath()

This commit is contained in:
2021-03-23 18:37:32 +11:00
parent 072705005d
commit 92c5ee3e9d

View File

@@ -1,6 +1,5 @@
{% extends "base.html" %} {% block main_content %}
<div class="container-fluid">
<h3 class="offset-lg-2">{{page_title}}</h3>
<form id="psform" class="d-flex justify-content-center form-inline" method="POST" action="">
<input type="hidden" name="fe_msg_id" value="{{fe_msg_id}}"></input>
@@ -129,7 +128,6 @@
{% endif %}
{% set count=namespace( del=0, keep=0 ) %}
{% if page.cnt < pagesize %}
{% for dup in DD.per_path_dups %}
{% if DD.preferred_path[dup.did1] or DD.preferred_path[dup.did2] %}
<input id="kdid-{{loop.index}}" type="hidden" name="kdid-1">
@@ -140,12 +138,23 @@
<input type="hidden" name="kdid-{{loop.index}}" value="DD.preferred_path[dup.did2]">
{% endif %}
{% set count.keep = count.keep + 1 %}
{% else %}
{% elif page.cnt <= pagesize %}
<div class="col-lg-12 py-2">
<h5 class="col-lg-12 mt-3">Choose path to KEEP (same file names in 2 different directories):</h5>
{{dup.count}} duplicates in:
<alert id="kd{{loop.index}}-d1" style="cursor: pointer;" onClick="KeepDir({{loop.index}}, 1)" class="alert">{{dup.d1}}</alert> or
<alert id="kd{{loop.index}}-d2" style="cursor: pointer;" onClick="KeepDir({{loop.index}}, 2)" class="alert">{{dup.d2}}</alert>
{% if dup.d1 == "" %}
{% set d1="/" %}
{% else %}
{% set d1=dup.d1 %}
{% endif %}
{% if dup.d2 == "" %}
{% set d2="/" %}
{% else %}
{% set d2=dup.d2 %}
{% endif %}
<alert id="kd{{loop.index}}-d1" style="cursor: pointer;" onClick="KeepDir({{loop.index}}, 1)" class="alert">{{d1}}</alert> or
<alert id="kd{{loop.index}}-d2" style="cursor: pointer;" onClick="KeepDir({{loop.index}}, 2)" class="alert">{{d2}}</alert>
<input id="kdid-{{loop.index}}" type="hidden" name="kdid-{{loop.index}}">
<input name="kdhash-{{loop.index}}" type="hidden" value="{{dup.hashes}}">
<script>
@@ -153,13 +162,9 @@
D[{{loop.index}}2]="{{dup.did2}}"
</script>
</div>
{% endif %}
{% set page.cnt = page.cnt + 1 %}
{% if page.cnt == pagesize %}
{% break %}
{% endif %}
{% endfor %}
{% endif %}
{% if count.keep %}
<div class="col-lg-12">
{% set auto.str = auto.str + "<li>Keeping={}, Deleting={} paths of duplicates</li>".format(count.keep, count.keep) %}