{% extends "base.html" %} {% block title %}File Manager – Admin{% endblock %} {% block content %}

File Manager Admin Only

{{ workdir }}

{% if total_disk is none %}…{% else %}{{ total_disk }}{% endif %} on disk {{ total_db }} in DB {% if total_disk is not none and total_disk != total_db %} Delta detected {% endif %}
Filesystem Database Records Reconcile {% if total_disk != total_db %} ! {% endif %}
{% if view == 'filesystem' %}
Found in DB Not in DB (orphan)
{% if current_path %} {% endif %} {% if fs_entries %} {% for entry in fs_entries %} {% endfor %} {% else %} {% endif %}
Name DB Actions
..
{% if entry.is_dir %} {{ entry.name }} {% else %} {{ entry.name }} {% endif %} {% if entry.db_status == 'in_db' %} In DB {% elif entry.db_status == 'orphan' %} Orphan {% endif %} {% if not entry.is_dir %} Download {% endif %}
This directory is empty.
{% endif %} {% if view == 'database' %}
File exists on disk File missing from disk Path not set
{% if db_records %}
{% for rec in db_records %} {# Helper macro: render a path cell #} {% for path_info in [rec.local, rec.original, rec.processed] %} {% endfor %} {% endfor %}
ID Original Filename local_filename original_file_path processed_file_path Health
{{ rec.id }} {% if rec.is_duplicate %} dup {% endif %} {{ rec.original_filename }} {% if path_info.path is none %} {% elif path_info.exists %} {{ path_info.rel }} {% else %} {{ path_info.rel }} {% endif %} {% if rec.health == 'ok' %} OK {% else %} Missing {% endif %}
{% else %}
No file records found in the database.
{% endif %} {% endif %} {% if view == 'reconcile' %} {% if orphan_files or ghost_records %}
Delta detected. Found {{ orphan_files | length }} orphan file(s) on disk with no DB record, and {{ ghost_records | length }} DB record(s) with missing files on disk.
{% else %}
No delta found — filesystem and database are in sync.
{% endif %}

Orphan files (on disk, no DB record) {{ orphan_files | length }}

{% if orphan_files %}
{% for f in orphan_files %} {% endfor %}
Path (relative to workdir) Actions
{{ f.rel_path }} Download
{% else %}

No orphan files found.

{% endif %}

Ghost records (in DB, file(s) missing on disk) {{ ghost_records | length }}

{% if ghost_records %}
{% for rec in ghost_records %} {% endfor %}
ID Original Filename Missing paths
{{ rec.id }} {{ rec.original_filename }} {% for path_info in [rec.local, rec.original, rec.processed] %} {% if path_info.exists is sameas false %}
{{ path_info.rel }}
{% endif %} {% endfor %}
{% else %}

No ghost records found.

{% endif %}
{% endif %}
{% endblock %}