{% extends "base.html" %} {% block main_content %}

{{page_title}}

 duplicates at a time  
{# pass this through so that the back-end can delete this message when it rm_dups #} {% set auto=namespace(str="") %} {% set page=namespace(cnt=0) %} {% set pref=namespace(have="") %} {% set count=namespace( del=0, keep=0 ) %} {# for each hash in ip_to_sp_dups_*, auto keep the _keep, auto delete the _del, only need hidden input #} {% for h in DD.ip_to_sp_dups_keep %} {% set count.keep = count.keep+1 %} {% set count.del = count.del + DD.ip_to_sp_dups_del[h]|length %} {% endfor %} {% if count.keep %} {% set auto.str = auto.str + "
  • Keeping {} files in storage path and deleting {} from import path
  • ".format(count.keep, count.del) %} {% endif %}
    Choose between these files:
    {% set count=namespace( del=0, keep=0 ) %} {% for dups in DD.per_file_dups %} {% set outer_loop=loop.index %} {% set pref.have="" %} {% for dup in dups %} {# for each hash in preferred_file, auto keep it, only need hidden input, dont process further #} {% if DD.preferred_file[dup.h] %} {% set pref.have = "True" %} {% if DD.preferred_file[dup.h] == dup.id %} {% set count.keep = count.keep + 1 %} {% else %} {% set count.del = count.del + (dups|length-1) %} {% endif %} {% else %} {# okay, show an alert / make it choosable for each of these manually processed dups #} {% if page.cnt <= pagesize %} {% if loop.index == 1 %}
    {% endif %} {{dup.d}}/{{dup.f}} {% if DD.preferred_file[dup.h] == dup.id %} {% set pref.have="kf{}-f{}".format(outer_loop,loop.index) %} {% endif %} {% if loop.index < dups|length %} or {% else %} {% endif %} {% if loop.index == dups|length %}
    {% endif %} {% endif %} {% endif %} {% endfor %} {% if pref.have == "" %} {% set page.cnt = page.cnt + 1 %} {% endif %} {% endfor %} {% if count.keep %} {% set auto.str = auto.str + "
  • Duplicates in storage path matching naming convention: Keep={}, Delete={}
  • ".format(count.keep, count.del) %} {% 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] %} {% if DD.preferred_path[dup.did1] %} {% else %} {% endif %} {% set count.keep = count.keep + 1 %} {% else %}
    Choose path to KEEP (same file names in 2 different directories):
    {{dup.count}} duplicates in: {{dup.d1}} or {{dup.d2}}
    {% endif %} {% set page.cnt = page.cnt + 1 %} {% if page.cnt == pagesize %} {% break %} {% endif %} {% endfor %} {% endif %} {% if count.keep %}
    {% set auto.str = auto.str + "
  • Keeping={}, Deleting={} paths of duplicates
  • ".format(count.keep, count.keep) %}
    {% endif %} {% if auto.str|length %} AUTOMATICALLY matched naming conventions resulting in:
      {{auto.str|safe}}
    {% endif %}
    {% endblock main_content %} {% block script_content %} {% endblock script_content %}