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