This commit is contained in:
Lars Behrends
2025-10-18 22:03:30 +02:00
parent f4c1cfc164
commit ca2d3a6960
45 changed files with 4827 additions and 326 deletions

View File

@@ -0,0 +1,55 @@
{% extends "layouts/app.twig" %}
{% block content %}
<div class="px-4 py-3">
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 fw-bold text-dark mb-1">Adult Performers</h1>
<p class="text-muted mb-0">{{ actors|length }} performer{{ actors|length != 1 ? 's' : '' }}</p>
</div>
</div>
{% if actors %}
<div class="row g-3">
{% for actor in actors %}
<div class="col-md-6 col-lg-4 col-xl-3">
<div class="card h-100">
<div class="card-body text-center">
<a href="{{ path_for('actors.show', {'id': actor.id}) }}" class="text-decoration-none">
{% if actor.thumbnail_path %}
<img src="/public/images/{{ actor.thumbnail_path }}" alt="{{ actor.name }}" class="rounded-circle mb-3" style="width: 80px; height: 80px; object-fit: cover;">
{% else %}
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center mb-3 mx-auto" style="width: 80px; height: 80px;">
<svg class="text-muted" width="40" height="40" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
</div>
{% endif %}
<h5 class="card-title mb-2">{{ actor.name }}</h5>
<p class="card-text small text-muted">
{{ actor.total_media_count }} scene{{ actor.total_media_count != 1 ? 's' : '' }}
</p>
{% if actor.latest_scene_date %}
<small class="text-muted d-block">
Latest: {{ actor.latest_scene_date|date('M j, Y') }}
</small>
{% endif %}
</a>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="text-center py-5">
<svg class="text-muted mb-3" width="64" height="64" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
</svg>
<h5 class="text-muted">No performers found</h5>
<p class="text-muted">Performers will appear here once you sync content from your adult video sources.</p>
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -0,0 +1,118 @@
{% extends "layouts/app.twig" %}
{% block content %}
<div class="px-4 py-3">
<!-- Back button -->
<div class="mb-4">
<a href="{{ path_for('actors.index') }}" class="btn btn-outline-secondary btn-sm">
<svg class="me-2" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/>
</svg>
Back to Performers
</a>
</div>
<div class="card">
<div class="row g-0">
<!-- Actor image -->
<div class="col-md-4">
<div class="card-body">
<div class="text-center">
{% if actor.thumbnail_path %}
<img src="/public/images/{{ actor.thumbnail_path }}" alt="{{ actor.name }}" class="rounded-circle mb-3" style="width: 150px; height: 150px; object-fit: cover;">
{% else %}
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center mb-3 mx-auto" style="width: 150px; height: 150px;">
<svg class="text-muted" width="75" height="75" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
</div>
{% endif %}
<h1 class="h3 fw-bold text-dark mb-2">{{ actor.name }}</h1>
<p class="text-muted">{{ actor.scene_count }} scene{{ actor.scene_count != 1 ? 's' : '' }}</p>
</div>
</div>
</div>
<!-- Actor details and scenes -->
<div class="col-md-8">
<div class="card-body">
<!-- Actor stats -->
<div class="row g-3 mb-4">
<div class="col-sm-6">
<div class="d-flex align-items-center">
<svg class="me-2 text-primary" width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
</svg>
<div>
<div class="fw-semibold">{{ actor.scene_count }}</div>
<small class="text-muted">Total Scenes</small>
</div>
</div>
</div>
{% if actor.scene_count > 0 %}
<div class="col-sm-6">
<div class="d-flex align-items-center">
<svg class="me-2 text-success" width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
<div>
<div class="fw-semibold">{{ actor.latest_scene_date|date('M j, Y') }}</div>
<small class="text-muted">Latest Scene</small>
</div>
</div>
</div>
{% endif %}
</div>
<!-- Scenes by this actor -->
{% if scenes %}
<div>
<h3 class="h5 fw-semibold text-dark mb-3">Scenes featuring {{ actor.name }}</h3>
<div class="row g-3">
{% for scene in scenes %}
<div class="col-md-6 col-lg-4">
<div class="card h-100">
<div style="background-color: #f8f9fa; height: 150px; overflow: hidden;">
{% if scene.poster_url %}
<img src="/public/images/{{ scene.poster_url }}" alt="{{ scene.title }}" class="w-100 h-100" style="object-fit: cover;">
{% else %}
<div class="w-100 h-100 d-flex align-items-center justify-content-center">
<svg class="text-muted" width="48" height="48" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
</svg>
</div>
{% endif %}
</div>
<div class="card-body">
<h6 class="card-title mb-1">
<a href="{{ path_for('adult.show', {'id': scene.id}) }}" class="text-decoration-none">{{ scene.title }}</a>
</h6>
<p class="card-text small text-muted">
{{ scene.release_date|date('M j, Y') }}
{% if scene.runtime_minutes %}
{{ (scene.runtime_minutes / 60)|round(1) }}h {{ scene.runtime_minutes % 60 }}m
{% endif %}
</p>
<small class="text-muted">{{ scene.source_name }}</small>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% else %}
<div class="text-center py-5">
<svg class="text-muted mb-3" width="64" height="64" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
</svg>
<h5 class="text-muted">No scenes found</h5>
<p class="text-muted">This performer hasn't appeared in any scenes yet.</p>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -30,6 +30,34 @@
<div class="mb-3">
<!-- Sync Buttons -->
{% if source.name == 'jellyfin' %}
<!-- Jellyfin-specific sync options -->
<div class="d-flex gap-1 mb-2 flex-wrap">
<button onclick="startSync({{ source.id }}, 'all')"
class="btn btn-primary btn-sm flex-fill">
All Content
</button>
<button onclick="startSync({{ source.id }}, 'movies')"
class="btn btn-outline-primary btn-sm flex-fill">
Movies Only
</button>
<button onclick="startSync({{ source.id }}, 'tvshows')"
class="btn btn-outline-primary btn-sm flex-fill">
TV Shows Only
</button>
</div>
<div class="d-flex gap-1 mb-2">
<button onclick="startSync({{ source.id }}, 'full')"
class="btn btn-secondary btn-sm flex-fill">
Full Sync
</button>
<button onclick="startSync({{ source.id }}, 'incremental')"
class="btn btn-outline-secondary btn-sm flex-fill">
Incremental
</button>
</div>
{% else %}
<!-- Standard sync options for other sources -->
<div class="d-flex gap-2 mb-2">
<button onclick="startSync({{ source.id }}, 'full')"
class="btn btn-primary btn-sm flex-fill">
@@ -40,6 +68,7 @@
Incremental
</button>
</div>
{% endif %}
<!-- Last Sync Status -->
{% if source.last_sync_at %}
@@ -159,6 +188,13 @@
progressBar.style.width = '0%';
statusDiv.textContent = 'Starting sync...';
// Disable all sync buttons for this source
const buttons = document.querySelectorAll(`[onclick*="startSync(${sourceId},"]`);
buttons.forEach(button => {
button.disabled = true;
button.textContent = 'Syncing...';
});
// Start sync via API
fetch(`/admin/sync/${sourceId}?type=${syncType}`, {
method: 'POST',
@@ -171,19 +207,29 @@
.then(data => {
if (data.success) {
// Start monitoring sync status
monitorSyncStatus(data.sync_log_id, sourceId, progressBar, statusDiv);
monitorSyncStatus(data.sync_log_id, sourceId, progressBar, statusDiv, buttons);
} else {
statusDiv.textContent = 'Error: ' + (data.message || 'Unknown error');
progressDiv.classList.add('d-none');
// Re-enable buttons on error
buttons.forEach(button => {
button.disabled = false;
button.textContent = button.textContent.replace('Syncing...', '').trim();
});
}
})
.catch(error => {
statusDiv.textContent = 'Error: ' + error.message;
progressDiv.classList.add('d-none');
// Re-enable buttons on error
buttons.forEach(button => {
button.disabled = false;
button.textContent = button.textContent.replace('Syncing...', '').trim();
});
});
}
function monitorSyncStatus(syncLogId, sourceId, progressBar, statusDiv) {
function monitorSyncStatus(syncLogId, sourceId, progressBar, statusDiv, buttons) {
const interval = setInterval(() => {
fetch(`/admin/sync/status/${syncLogId}`)
.then(response => response.json())
@@ -208,6 +254,12 @@
// Refresh page to show updated sync log
location.reload();
}, 2000);
} else {
// Re-enable buttons on failure
buttons.forEach(button => {
button.disabled = false;
button.textContent = button.textContent.replace('Syncing...', '').trim();
});
}
}
})
@@ -215,6 +267,11 @@
console.error('Error monitoring sync:', error);
clearInterval(interval);
delete syncIntervals[sourceId];
// Re-enable buttons on error
buttons.forEach(button => {
button.disabled = false;
button.textContent = button.textContent.replace('Syncing...', '').trim();
});
});
}, 1000);

View File

@@ -141,18 +141,20 @@
<h4 class="h6 fw-semibold text-dark mb-2">Performers</h4>
<div class="d-flex flex-wrap gap-2">
{% for actor in movie.actors %}
<div class="d-flex flex-column align-items-center" style="width: 60px;">
{% if actor.thumbnail_path %}
<img src="{{ actor.thumbnail_path }}" alt="{{ actor.name }}" class="rounded-circle mb-1" style="width: 40px; height: 40px; object-fit: cover;">
{% else %}
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center mb-1" style="width: 40px; height: 40px;">
<svg class="text-muted" width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
<a href="{{ path_for('actors.show', {'id': actor.id}) }}" class="text-decoration-none">
<div class="d-flex flex-column align-items-center" style="width: 60px;">
{% if actor.thumbnail_path %}
<img src="/public/images/{{ actor.thumbnail_path }}" alt="{{ actor.name }}" class="rounded-circle mb-1" style="width: 40px; height: 40px; object-fit: cover;">
{% else %}
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center mb-1" style="width: 40px; height: 40px;">
<svg class="text-muted" width="20" height="20" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
</svg>
</div>
{% endif %}
<span class="small text-muted text-center" style="font-size: 0.75rem;">{{ actor.name }}</span>
</div>
{% endif %}
<span class="small text-muted text-center" style="font-size: 0.75rem;">{{ actor.name }}</span>
</div>
</a>
{% endfor %}
</div>
</div>

View File

@@ -42,8 +42,14 @@
<li class="nav-item">
<a class="nav-link {% if current_route == 'music.index' %}active{% endif %}" href="{{ path_for('music.index') }}">Music</a>
</li>
<li class="nav-item">
<a class="nav-link {% if current_route == 'adult.index' %}active{% endif %}" href="{{ path_for('adult.index') }}">Adult Videos</a>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle {% if current_route == 'adult.index' or current_route == 'actors.index' %}active{% endif %}" href="#" id="adultDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Adult Videos
</a>
<ul class="dropdown-menu" aria-labelledby="adultDropdown">
<li><a class="dropdown-item {% if current_route == 'adult.index' %}active{% endif %}" href="{{ path_for('adult.index') }}">Videos</a></li>
<li><a class="dropdown-item {% if current_route == 'actors.index' %}active{% endif %}" href="{{ path_for('actors.index') }}">Performers</a></li>
</ul>
</li>
</ul>