ttvdrops/templates/twitch/debug.html

160 lines
7.1 KiB
HTML

{% extends "base.html" %}
{% block title %}
Debug
{% endblock title %}
{% block content %}
<h1 id="page-title">Debug Data Integrity Report</h1>
<p>
Generated at: <time id="generation-time">{{ now }}</time>
</p>
<section>
<h2 id="operation-names-header">Distinct GraphQL operation_names ({{ operation_names_with_counts|length }})</h2>
{% if operation_names_with_counts %}
<table id="operation-names-table">
<thead>
<tr>
<th>Operation Name</th>
<th>Count</th>
</tr>
</thead>
<tbody>
{% for item in operation_names_with_counts %}
<tr>
<td>{{ item.trimmed_op }}</td>
<td>{{ item.count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
</section>
<section>
<h2 id="games-without-owner-header">Games Without an Assigned Owner ({{ games_without_owner|length }})</h2>
{% if games_without_owner %}
<ul id="games-without-owner-list">
{% for game in games_without_owner %}
<li id="game-{{ game.twitch_id }}">
<a href="{% url 'twitch:game_detail' game.twitch_id %}">{{ game.display_name }}</a> (ID: {{ game.twitch_id }})
</li>
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="broken-image-campaigns-header">Campaigns With Broken Image URLs ({{ broken_image_campaigns|length }})</h2>
{% if broken_image_campaigns %}
<ul id="broken-image-campaigns-list">
{% for c in broken_image_campaigns %}
<li id="campaign-{{ c.twitch_id }}">
<a href="{% url 'twitch:campaign_detail' c.twitch_id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.twitch_id %}">{{ c.game.display_name }}</a>)
- URL: {{ c.image_best_url|default:c.image_url|default:'(empty)' }}
</li>
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="broken-benefit-images-header">Benefits With Broken Image URLs ({{ broken_benefit_images|length }})</h2>
{% if broken_benefit_images %}
<ul id="broken-benefit-images-list">
{% for b in broken_benefit_images %}
{# A benefit is linked to a game via a drop and a campaign. #}
{# We use the 'with' tag to get the first drop for cleaner access. #}
{% with first_drop=b.drops.all.0 %}
<li id="benefit-{{ b.twitch_id }}">
{{ b.name }}
{# Check if the relationship path to the game exists #}
{% if first_drop and first_drop.campaign and first_drop.campaign.game %}
(Game: <a href="{% url 'twitch:game_detail' first_drop.campaign.game.twitch_id %}">{{ first_drop.campaign.game.display_name }}</a>)
{% else %}
(Game: Not linked)
{% endif %}
- URL: {{ b.image_best_url|default:b.image_asset_url|default:'(empty)' }}
</li>
{% endwith %}
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="active-missing-image-header">Active Campaigns Missing Image ({{ active_missing_image|length }})</h2>
{% if active_missing_image %}
<ul id="active-missing-image-list">
{% for c in active_missing_image %}
<li id="campaign-{{ c.twitch_id }}">
<a href="{% url 'twitch:campaign_detail' c.twitch_id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.twitch_id %}">{{ c.game.display_name }}</a>)
</li>
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="drops-without-benefits-header">Time-Based Drops Without Benefits ({{ drops_without_benefits|length }})</h2>
{% if drops_without_benefits %}
<ul id="drops-without-benefits-list">
{% for d in drops_without_benefits %}
<li id="drop-{{ d.twitch_id }}">
{{ d.name }}
(Campaign: <a href="{% url 'twitch:campaign_detail' d.campaign.twitch_id %}">{{ d.campaign.name }}</a>
in Game: <a href="{% url 'twitch:game_detail' d.campaign.game.twitch_id %}">{{ d.campaign.game.display_name }}</a>)
</li>
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="invalid-date-campaigns-header">Campaigns With Invalid Dates ({{ invalid_date_campaigns|length }})</h2>
{% if invalid_date_campaigns %}
<ul id="invalid-date-campaigns-list">
{% for c in invalid_date_campaigns %}
<li id="campaign-{{ c.twitch_id }}">
<a href="{% url 'twitch:campaign_detail' c.twitch_id %}">{{ c.name }}</a>
(Game: <a href="{% url 'twitch:game_detail' c.game.twitch_id %}">{{ c.game.display_name }}</a>)
- Start: {{ c.start_at|default:'(none)' }} / End: {{ c.end_at|default:'(none)' }}
</li>
{% endfor %}
</ul>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
<section>
<h2 id="duplicate-name-campaigns-header">Duplicate Campaign Names Per Game ({{ duplicate_name_campaigns|length }})</h2>
{% if duplicate_name_campaigns %}
<table id="duplicate-name-campaigns-table">
<thead>
<tr>
<th>Game</th>
<th>Campaign Name</th>
<th>Count</th>
</tr>
</thead>
<tbody>
{% for row in duplicate_name_campaigns %}
<tr>
<td>
<a href="{% url 'twitch:game_detail' row.game__twitch_id %}">{{ row.game__display_name }}</a>
</td>
<td>{{ row.name }}</td>
<td>{{ row.name_count }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>None ✅</p>
{% endif %}
</section>
{% endblock content %}