mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
impoort stuff!
This commit is contained in:
@@ -254,6 +254,12 @@
|
||||
<span>Sync Media</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path_for('admin.playnite.import') }}">
|
||||
<i class="bi bi-upload"></i>
|
||||
<span>Playnite Import</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ path_for('home') }}" target="_blank">
|
||||
<i bi bi-house-door"></i>
|
||||
|
||||
190
resources/views/admin/playnite/import.twig
Normal file
190
resources/views/admin/playnite/import.twig
Normal file
@@ -0,0 +1,190 @@
|
||||
{% extends "admin/layout.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-6 lg:px-8">
|
||||
<div class="sm:flex sm:items-center">
|
||||
<div class="sm:flex-auto">
|
||||
<h1 class="text-2xl font-semibold text-gray-900">Import Playnite Games</h1>
|
||||
<p class="mt-2 text-sm text-gray-700">
|
||||
Import games from Playnite export files. Playnite is a game library management application that can export your game library to JSON format.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if error %}
|
||||
<div class="mt-6 rounded-md bg-red-50 p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-red-800">Import Error</h3>
|
||||
<div class="mt-2 text-sm text-red-700">
|
||||
<p>{{ error }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-8 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-6">
|
||||
<div class="space-y-6">
|
||||
<!-- Import Instructions -->
|
||||
<div class="bg-blue-50 border border-blue-200 rounded-md p-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-blue-800">How to Export from Playnite</h3>
|
||||
<div class="mt-2 text-sm text-blue-700">
|
||||
<ol class="list-decimal list-inside space-y-1">
|
||||
<li>Open Playnite and go to Library → Export Library</li>
|
||||
<li>Choose "JSON" as the export format</li>
|
||||
<li>Select the games you want to export (or export all)</li>
|
||||
<li>Save the JSON file to your computer</li>
|
||||
<li>Upload the file using the form below</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Upload Form -->
|
||||
<form action="{{ path_for('admin.playnite.upload') }}" method="post" enctype="multipart/form-data" class="space-y-6">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<div>
|
||||
<label for="playnite_file" class="block text-sm font-medium text-gray-700">
|
||||
Playnite Export File
|
||||
</label>
|
||||
<div class="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md">
|
||||
<div class="space-y-1 text-center">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400" stroke="currentColor" fill="none" viewBox="0 0 48 48">
|
||||
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
<div class="flex text-sm text-gray-600">
|
||||
<label for="playnite_file" class="relative cursor-pointer bg-white rounded-md font-medium text-indigo-600 hover:text-indigo-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-indigo-500">
|
||||
<span>Upload a file</span>
|
||||
<input id="playnite_file" name="playnite_file" type="file" class="sr-only" accept=".json">
|
||||
</label>
|
||||
<p class="pl-1">or drag and drop</p>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500">JSON files only</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Options -->
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<h3 class="text-sm font-medium text-gray-900 mb-3">Import Options</h3>
|
||||
<div class="space-y-3">
|
||||
<div class="flex items-start">
|
||||
<div class="flex items-center h-5">
|
||||
<input id="update_existing" name="update_existing" type="checkbox" class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" checked>
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label for="update_existing" class="font-medium text-gray-700">Update existing games</label>
|
||||
<p class="text-gray-500">If a game with the same Playnite ID already exists, update it with the new data instead of creating a duplicate.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Submit Button -->
|
||||
<div class="flex justify-end space-x-3">
|
||||
<a href="{{ path_for('admin.index') }}" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Cancel
|
||||
</a>
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Upload & Preview
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Recent Imports -->
|
||||
<div class="mt-8">
|
||||
<h2 class="text-lg font-medium text-gray-900 mb-4">Recent Playnite Imports</h2>
|
||||
<div class="bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4">
|
||||
<p class="text-sm text-gray-500">No recent imports found. Import history will appear here.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// File upload preview
|
||||
document.getElementById('playnite_file').addEventListener('change', function(e) {
|
||||
const file = e.target.files[0];
|
||||
if (file) {
|
||||
const fileName = file.name;
|
||||
const fileSize = (file.size / 1024 / 1024).toFixed(2) + ' MB';
|
||||
|
||||
// Update the UI to show file info without destroying the file input
|
||||
const uploadArea = document.querySelector('.border-dashed');
|
||||
const textElements = uploadArea.querySelectorAll('span, p');
|
||||
|
||||
// Update the text content instead of replacing HTML
|
||||
if (textElements.length >= 2) {
|
||||
textElements[0].textContent = fileName;
|
||||
textElements[1].textContent = `${fileSize} - Ready to import`;
|
||||
}
|
||||
|
||||
// Change the SVG to a success icon
|
||||
const svg = uploadArea.querySelector('svg');
|
||||
if (svg) {
|
||||
svg.innerHTML = '<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />';
|
||||
svg.className = 'mx-auto h-12 w-12 text-green-400';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Drag and drop functionality
|
||||
const uploadArea = document.querySelector('.border-dashed');
|
||||
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
||||
uploadArea.addEventListener(eventName, preventDefaults, false);
|
||||
document.body.addEventListener(eventName, preventDefaults, false);
|
||||
});
|
||||
|
||||
['dragenter', 'dragover'].forEach(eventName => {
|
||||
uploadArea.addEventListener(eventName, highlight, false);
|
||||
});
|
||||
|
||||
['dragleave', 'drop'].forEach(eventName => {
|
||||
uploadArea.addEventListener(eventName, unhighlight, false);
|
||||
});
|
||||
|
||||
uploadArea.addEventListener('drop', handleDrop, false);
|
||||
|
||||
function preventDefaults(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
function highlight(e) {
|
||||
uploadArea.classList.add('border-indigo-500');
|
||||
}
|
||||
|
||||
function unhighlight(e) {
|
||||
uploadArea.classList.remove('border-indigo-500');
|
||||
}
|
||||
|
||||
function handleDrop(e) {
|
||||
const dt = e.dataTransfer;
|
||||
const files = dt.files;
|
||||
|
||||
if (files.length > 0) {
|
||||
document.getElementById('playnite_file').files = files;
|
||||
document.getElementById('playnite_file').dispatchEvent(new Event('change'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
333
resources/views/admin/playnite/preview.twig
Normal file
333
resources/views/admin/playnite/preview.twig
Normal file
@@ -0,0 +1,333 @@
|
||||
{% extends "admin/layout.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-6 lg:px-8">
|
||||
<div class="sm:flex sm:items-center">
|
||||
<div class="sm:flex-auto">
|
||||
<h1 class="text-2xl font-semibold text-gray-900">Preview Playnite Import</h1>
|
||||
<p class="mt-2 text-sm text-gray-700">
|
||||
Review the games that will be imported from "{{ filename }}". Check the details below and click "Import Games" to proceed.
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
|
||||
<a href="{{ path_for('admin.playnite.import') }}" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
← Back to Import
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Summary -->
|
||||
<div class="mt-8 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h3 class="text-lg font-medium text-gray-900">Import Summary</h3>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Total Games</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-gray-900">{{ preview.total }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Valid Games</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-green-600">{{ preview.valid }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Invalid Games</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-red-600">{{ preview.invalid }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Sources</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-gray-900">{{ preview.games|length > 0 ? (preview.games|first).source_name : 'N/A' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if preview.errors %}
|
||||
<!-- Import Errors -->
|
||||
<div class="mt-6 bg-red-50 border border-red-200 rounded-md">
|
||||
<div class="px-6 py-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-red-800">Import Errors</h3>
|
||||
<div class="mt-2 text-sm text-red-700">
|
||||
<ul class="space-y-1">
|
||||
{% for error in preview.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Games Preview -->
|
||||
<div class="mt-6 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-lg font-medium text-gray-900">Games to Import</h3>
|
||||
<div class="flex space-x-2">
|
||||
<button type="button" onclick="toggleAllDetails()" class="inline-flex items-center px-3 py-1 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Toggle All Details
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="divide-y divide-gray-200">
|
||||
{% for game in preview.games %}
|
||||
<div class="px-6 py-4 game-item" data-game-index="{{ loop.index }}">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-4">
|
||||
{% if game.cover_image %}
|
||||
<img class="h-16 w-16 rounded-lg object-cover" src="{{ game.cover_image }}" alt="{{ game.title }}">
|
||||
{% else %}
|
||||
<div class="h-16 w-16 rounded-lg bg-gray-200 flex items-center justify-center">
|
||||
<svg class="h-8 w-8 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<h4 class="text-lg font-medium text-gray-900">{{ game.title }}</h4>
|
||||
<div class="flex items-center space-x-4 text-sm text-gray-500">
|
||||
{% if game.genre %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
||||
{{ game.genre }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if game.platform %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
{{ game.platform }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if game.release_date %}
|
||||
<span>{{ game.release_date|date('Y') }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" onclick="toggleGameDetails('game-{{ loop.index }}')"
|
||||
class="text-indigo-600 hover:text-indigo-900 text-sm font-medium">
|
||||
Show Details
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Game Details (hidden by default) -->
|
||||
<div id="details-game-{{ loop.index }}" class="hidden mt-4 bg-gray-50 rounded-lg p-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Game Information -->
|
||||
<div>
|
||||
<h5 class="text-sm font-medium text-gray-900 mb-3">Game Information</h5>
|
||||
<dl class="space-y-2">
|
||||
{% if game.developer %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Developer:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.developer }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.publisher %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Publisher:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.publisher }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.release_date %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Release Date:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.release_date|date('M j, Y') }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.rating %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Rating:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.rating }}/10</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.playtime_minutes %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Playtime:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ (game.playtime_minutes / 60)|round(1) }} hours</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.critic_score %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Critic Score:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.critic_score }}%</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Platform & Status -->
|
||||
<div>
|
||||
<h5 class="text-sm font-medium text-gray-900 mb-3">Platform & Status</h5>
|
||||
<dl class="space-y-2">
|
||||
{% if game.source_name %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Source:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.source_name }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.is_installed %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Status:</dt>
|
||||
<dd class="text-sm">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
Installed
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.is_favorite %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Favorite:</dt>
|
||||
<dd class="text-sm">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
|
||||
Yes
|
||||
</span>
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if game.completion_percentage > 0 %}
|
||||
<div class="flex justify-between">
|
||||
<dt class="text-sm text-gray-500">Completion:</dt>
|
||||
<dd class="text-sm text-gray-900">{{ game.completion_percentage }}%</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if game.description %}
|
||||
<div class="mt-4">
|
||||
<h5 class="text-sm font-medium text-gray-900 mb-2">Description</h5>
|
||||
<p class="text-sm text-gray-600 line-clamp-3">{{ game.description|striptags|slice(0, 200) }}{% if game.description|length > 200 %}...{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if game.genres_json %}
|
||||
<div class="mt-4">
|
||||
<h5 class="text-sm font-medium text-gray-900 mb-2">Genres</h5>
|
||||
<div class="flex flex-wrap gap-1">
|
||||
{% for genre in game.genres_json %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
||||
{{ genre.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if game.tags_json %}
|
||||
<div class="mt-4">
|
||||
<h5 class="text-sm font-medium text-gray-900 mb-2">Tags</h5>
|
||||
<div class="flex flex-wrap gap-1">
|
||||
{% for tag in game.tags_json|slice(0, 10) %}
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-gray-100 text-gray-800">
|
||||
{{ tag.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% if game.tags_json|length > 10 %}
|
||||
<span class="text-xs text-gray-500">+{{ game.tags_json|length - 10 }} more</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Form -->
|
||||
<div class="mt-6 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h3 class="text-lg font-medium text-gray-900">Confirm Import</h3>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<form action="{{ path_for('admin.playnite.confirm') }}" method="post" class="space-y-4">
|
||||
<div class="flex items-start">
|
||||
<div class="flex items-center h-5">
|
||||
<input id="update_existing" name="update_existing" type="checkbox" class="focus:ring-indigo-500 h-4 w-4 text-indigo-600 border-gray-300 rounded" checked>
|
||||
</div>
|
||||
<div class="ml-3 text-sm">
|
||||
<label for="update_existing" class="font-medium text-gray-700">Update existing games</label>
|
||||
<p class="text-gray-500">If a game with the same Playnite ID already exists, update it with the new data instead of creating a duplicate.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end space-x-3">
|
||||
<a href="{{ path_for('admin.playnite.cancel') }}" class="bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Cancel
|
||||
</a>
|
||||
<button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Import {{ preview.valid }} Games
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleGameDetails(gameIndex) {
|
||||
const details = document.getElementById('details-game-' + gameIndex);
|
||||
const button = event.target;
|
||||
|
||||
if (details.classList.contains('hidden')) {
|
||||
details.classList.remove('hidden');
|
||||
button.textContent = 'Hide Details';
|
||||
} else {
|
||||
details.classList.add('hidden');
|
||||
button.textContent = 'Show Details';
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAllDetails() {
|
||||
const gameItems = document.querySelectorAll('.game-item');
|
||||
const allHidden = Array.from(gameItems).every(item => {
|
||||
const index = item.dataset.gameIndex;
|
||||
const details = document.getElementById('details-game-' + index);
|
||||
return details.classList.contains('hidden');
|
||||
});
|
||||
|
||||
gameItems.forEach(item => {
|
||||
const index = item.dataset.gameIndex;
|
||||
const details = document.getElementById('details-game-' + index);
|
||||
const button = item.querySelector('button');
|
||||
|
||||
if (allHidden) {
|
||||
details.classList.remove('hidden');
|
||||
button.textContent = 'Hide Details';
|
||||
} else {
|
||||
details.classList.add('hidden');
|
||||
button.textContent = 'Show Details';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Show first game's details by default
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const firstGameItem = document.querySelector('.game-item');
|
||||
if (firstGameItem) {
|
||||
const gameIndex = firstGameItem.dataset.gameIndex;
|
||||
const details = document.getElementById('details-game-' + gameIndex);
|
||||
if (details) {
|
||||
details.classList.remove('hidden');
|
||||
const button = firstGameItem.querySelector('button');
|
||||
if (button) {
|
||||
button.textContent = 'Hide Details';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
292
resources/views/admin/playnite/result.twig
Normal file
292
resources/views/admin/playnite/result.twig
Normal file
@@ -0,0 +1,292 @@
|
||||
{% extends "admin/layout.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-6 lg:px-8">
|
||||
<div class="sm:flex sm:items-center">
|
||||
<div class="sm:flex-auto">
|
||||
<h1 class="text-2xl font-semibold text-gray-900">Import Complete</h1>
|
||||
<p class="mt-2 text-sm text-gray-700">
|
||||
The Playnite import has been completed. Here's a summary of what was imported.
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none space-x-3">
|
||||
<a href="{{ path_for('admin.playnite.import') }}" class="inline-flex items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
Import More Games
|
||||
</a>
|
||||
<a href="{{ path_for('games.index') }}" class="inline-flex items-center justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
|
||||
View Games
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Results Summary -->
|
||||
<div class="mt-8 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h3 class="text-lg font-medium text-gray-900">Import Results</h3>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-6 sm:grid-cols-4">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Games Imported</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-green-600">{{ import_result.imported }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Games Updated</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-blue-600">{{ import_result.updated }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Games Skipped</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-gray-600">{{ import_result.skipped }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Errors</dt>
|
||||
<dd class="mt-1 text-2xl font-semibold text-red-600">{{ import_result.errors|length }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if import_result.errors %}
|
||||
<!-- Import Errors -->
|
||||
<div class="mt-6 bg-red-50 border border-red-200 rounded-md">
|
||||
<div class="px-6 py-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-red-800">Import Errors</h3>
|
||||
<div class="mt-2 text-sm text-red-700">
|
||||
<p class="font-medium">The following games could not be imported:</p>
|
||||
<ul class="mt-2 space-y-1">
|
||||
{% for error in import_result.errors %}
|
||||
<li class="flex items-start">
|
||||
<span class="flex-shrink-0 w-1.5 h-1.5 bg-red-400 rounded-full mt-2 mr-2"></span>
|
||||
{{ error }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if import_result.imported > 0 or import_result.updated > 0 %}
|
||||
<!-- Successfully Imported Games -->
|
||||
<div class="mt-6 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-lg font-medium text-gray-900">
|
||||
{% if import_result.imported > 0 %}Imported Games{% endif %}
|
||||
{% if import_result.imported > 0 and import_result.updated > 0 %} & {% endif %}
|
||||
{% if import_result.updated > 0 %}Updated Games{% endif %}
|
||||
</h3>
|
||||
<div class="flex space-x-2">
|
||||
<button type="button" onclick="toggleImportDetails()" class="inline-flex items-center px-3 py-1 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
|
||||
Toggle Details
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="import-details" class="hidden">
|
||||
<div class="divide-y divide-gray-200">
|
||||
{% for game in preview_data.games %}
|
||||
<div class="px-6 py-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center space-x-4">
|
||||
{% if game.cover_image %}
|
||||
<img class="h-12 w-12 rounded-lg object-cover" src="{{ game.cover_image }}" alt="{{ game.title }}">
|
||||
{% else %}
|
||||
<div class="h-12 w-12 rounded-lg bg-gray-200 flex items-center justify-center">
|
||||
<svg class="h-6 w-6 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-7 8h12a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-900">{{ game.title }}</h4>
|
||||
<div class="flex items-center space-x-2 text-xs text-gray-500">
|
||||
{% if game.platform %}
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-green-100 text-green-800">
|
||||
{{ game.platform }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if game.genre %}
|
||||
<span class="inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800">
|
||||
{{ game.genre }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-2">
|
||||
{% if import_result.imported > 0 %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
||||
New
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if import_result.updated > 0 %}
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
||||
Updated
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if game.description %}
|
||||
<div class="mt-2">
|
||||
<p class="text-xs text-gray-600 line-clamp-2">{{ game.description|striptags|slice(0, 150) }}{% if game.description|length > 150 %}...{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Import Statistics -->
|
||||
<div class="mt-6 bg-white shadow rounded-lg">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h3 class="text-lg font-medium text-gray-900">Import Statistics</h3>
|
||||
</div>
|
||||
<div class="px-6 py-4">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-3">Data Imported</h4>
|
||||
<dl class="space-y-2">
|
||||
{% set totalGames = import_result.imported + import_result.updated %}
|
||||
{% if totalGames > 0 %}
|
||||
<div class="flex justify-between text-sm">
|
||||
<dt class="text-gray-500">Games with descriptions:</dt>
|
||||
<dd class="text-gray-900">
|
||||
{% set withDescriptions = 0 %}
|
||||
{% for game in preview_data.games %}
|
||||
{% if game.description %}
|
||||
{% set withDescriptions = withDescriptions + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ withDescriptions }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<dt class="text-gray-500">Games with cover images:</dt>
|
||||
<dd class="text-gray-900">
|
||||
{% set withCovers = 0 %}
|
||||
{% for game in preview_data.games %}
|
||||
{% if game.cover_image %}
|
||||
{% set withCovers = withCovers + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ withCovers }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<dt class="text-gray-500">Games with ratings:</dt>
|
||||
<dd class="text-gray-900">
|
||||
{% set withRatings = 0 %}
|
||||
{% for game in preview_data.games %}
|
||||
{% if game.rating %}
|
||||
{% set withRatings = withRatings + 1 %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ withRatings }}
|
||||
</dd>
|
||||
</div>
|
||||
<div class="flex justify-between text-sm">
|
||||
<dt class="text-gray-500">Total playtime:</dt>
|
||||
<dd class="text-gray-900">
|
||||
{% set totalPlaytime = 0 %}
|
||||
{% for game in preview_data.games %}
|
||||
{% if game.playtime_minutes %}
|
||||
{% set totalPlaytime = totalPlaytime + game.playtime_minutes %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ (totalPlaytime / 60)|round(1) }} hours
|
||||
</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h4 class="text-sm font-medium text-gray-900 mb-3">Platform Distribution</h4>
|
||||
<dl class="space-y-2">
|
||||
{% set platforms = {} %}
|
||||
{% for game in preview_data.games %}
|
||||
{% if game.platform %}
|
||||
{% set platformKey = game.platform %}
|
||||
{% if platforms[platformKey] is defined %}
|
||||
{% set platforms = platforms|merge({(platformKey): platforms[platformKey] + 1}) %}
|
||||
{% else %}
|
||||
{% set platforms = platforms|merge({(platformKey): 1}) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% for platform, count in platforms %}
|
||||
<div class="flex justify-between text-sm">
|
||||
<dt class="text-gray-500">{{ platform }}:</dt>
|
||||
<dd class="text-gray-900">{{ count }} games</dd>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Next Steps -->
|
||||
<div class="mt-6 bg-blue-50 border border-blue-200 rounded-md">
|
||||
<div class="px-6 py-4">
|
||||
<div class="flex">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
|
||||
<path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="ml-3">
|
||||
<h3 class="text-sm font-medium text-blue-800">What happens next?</h3>
|
||||
<div class="mt-2 text-sm text-blue-700">
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
<li>The imported games are now available in your Games library</li>
|
||||
<li>Games are automatically grouped by title across different platforms</li>
|
||||
<li>Rich metadata including descriptions, ratings, and images are preserved</li>
|
||||
<li>You can update playtime and other statistics directly in the games interface</li>
|
||||
<li>Background sync processes will keep the data current if configured</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleImportDetails() {
|
||||
const details = document.getElementById('import-details');
|
||||
const button = event.target;
|
||||
|
||||
if (details.classList.contains('hidden')) {
|
||||
details.classList.remove('hidden');
|
||||
button.textContent = 'Hide Details';
|
||||
} else {
|
||||
details.classList.add('hidden');
|
||||
button.textContent = 'Show Details';
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-hide details after 5 seconds
|
||||
setTimeout(function() {
|
||||
const button = document.querySelector('button[onclick="toggleImportDetails()"]');
|
||||
if (button && !document.getElementById('import-details').classList.contains('hidden')) {
|
||||
// Details are already visible, leave them as is
|
||||
}
|
||||
}, 5000);
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="card-body">
|
||||
<div style="background-color: #f8f9fa; border-radius: 0.375rem; overflow: hidden;">
|
||||
{% if movie.poster_url %}
|
||||
<img src="{{ movie.poster_url }}" alt="{{ movie.title }}" class="w-100" style="max-height: 400px; object-fit: contain;">
|
||||
<img src="/images/{{ movie.poster_url }}" alt="{{ movie.title }}" class="w-100" style="max-height: 400px; object-fit: contain;">
|
||||
{% else %}
|
||||
<div class="w-100 h-100 d-flex align-items-center justify-content-center">
|
||||
<svg class="text-muted" width="96" height="96" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
@@ -28,6 +28,22 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="mt-3 d-grid gap-2">
|
||||
<button class="btn btn-primary">
|
||||
<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="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-6 8a9 9 0 110-18 9 9 0 010 18z"/>
|
||||
</svg>
|
||||
Mark as Watched
|
||||
</button>
|
||||
<button class="btn btn-outline-danger">
|
||||
<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="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
|
||||
</svg>
|
||||
Add to Favorites
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,6 +52,9 @@
|
||||
<div class="card-body">
|
||||
<div class="mb-4">
|
||||
<h1 class="display-5 fw-bold text-dark mb-2">{{ movie.title }}</h1>
|
||||
{% if movie.tagline %}
|
||||
<p class="lead text-muted mb-3">{{ movie.tagline }}</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- Video metadata -->
|
||||
<div class="d-flex flex-wrap gap-3 small text-muted mb-3">
|
||||
@@ -66,6 +85,15 @@
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.file_size %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2h4a1 1 0 010 2h-1v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6H3a1 1 0 010-2h4z"/>
|
||||
</svg>
|
||||
{{ movie.file_size|filesizeformat }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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"/>
|
||||
@@ -97,6 +125,15 @@
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.collection %}
|
||||
<span class="badge bg-info d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"/>
|
||||
</svg>
|
||||
{{ movie.collection }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -108,82 +145,209 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Additional details -->
|
||||
<div class="row g-3">
|
||||
<!-- Cast & Crew -->
|
||||
{% if movie.cast or movie.director or movie.writer or movie.actors %}
|
||||
<div class="col-md-6">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Cast & Crew</h3>
|
||||
<dl class="row g-2">
|
||||
{% if movie.director %}
|
||||
<div class="col-4">
|
||||
<dt class="small text-muted">Director</dt>
|
||||
<dd class="small text-dark">{{ movie.director }}</dd>
|
||||
<!-- Cast & Crew Section -->
|
||||
<div class="mb-4">
|
||||
<h2 class="h5 fw-semibold text-dark mb-3">Cast & Crew</h2>
|
||||
<div class="row g-3">
|
||||
{% if movie.director %}
|
||||
<div class="col-md-4">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg class="me-2 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>
|
||||
<small class="text-muted d-block">Director</small>
|
||||
<span class="fw-medium">{{ movie.director }}</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.writer %}
|
||||
<div class="col-4">
|
||||
<dt class="small text-muted">Writer</dt>
|
||||
<dd class="small text-dark">{{ movie.writer }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.cast %}
|
||||
<div class="col-12">
|
||||
<dt class="small text-muted">Cast</dt>
|
||||
<dd class="small text-dark">{{ movie.cast }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Actors with thumbnails -->
|
||||
{% if movie.actors %}
|
||||
<div class="mt-3">
|
||||
<h4 class="h6 fw-semibold text-dark mb-2">Performers</h4>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for actor in movie.actors %}
|
||||
<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>
|
||||
{% if movie.cast %}
|
||||
<div class="col-md-8">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg class="me-2 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="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>
|
||||
<div>
|
||||
<small class="text-muted d-block">Cast</small>
|
||||
<div class="d-flex flex-wrap gap-1">
|
||||
{% for actor in movie.cast|split(',') %}
|
||||
<span class="badge bg-light text-dark">{{ actor|trim }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Performers with thumbnails -->
|
||||
{% if movie.actors %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Performers</h3>
|
||||
<div class="d-flex flex-wrap gap-3">
|
||||
{% for actor in movie.actors %}
|
||||
<a href="{{ path_for('actors.show', {'id': actor.id}) }}" class="text-decoration-none">
|
||||
<div class="d-flex flex-column align-items-center" style="width: 80px;">
|
||||
{% if actor.thumbnail_path %}
|
||||
<img src="/images/{{ actor.thumbnail_path }}" alt="{{ actor.name }}" class="rounded-circle mb-2" style="width: 50px; height: 50px; object-fit: cover;">
|
||||
{% else %}
|
||||
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center mb-2" style="width: 50px; height: 50px;">
|
||||
<svg class="text-muted" width="24" height="24" 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>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Video Details Grid -->
|
||||
<div class="row g-3 mb-4">
|
||||
<!-- Genres & Categories -->
|
||||
{% if movie.genre or movie.categories %}
|
||||
<div class="col-md-6">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Categories</h3>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% if movie.genre %}
|
||||
{% for genre in movie.genre|split(',') %}
|
||||
<span class="badge bg-primary">{{ genre|trim }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if movie.categories %}
|
||||
{% for category in movie.categories|split(',') %}
|
||||
<span class="badge bg-secondary">{{ category|trim }}</span>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Genres & Studios -->
|
||||
{% if movie.genre or metadata.studios %}
|
||||
<!-- Technical Details -->
|
||||
{% if movie.video_codec or movie.audio_codec or movie.resolution or movie.bitrate %}
|
||||
<div class="col-md-6">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Details</h3>
|
||||
<dl class="row g-2">
|
||||
{% if movie.genre %}
|
||||
<div class="col-4">
|
||||
<dt class="small text-muted">Genre</dt>
|
||||
<dd class="small text-dark">{{ movie.genre }}</dd>
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Technical Details</h3>
|
||||
<div class="row g-2">
|
||||
{% if movie.video_codec %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Video Codec</small>
|
||||
<span class="fw-medium">{{ movie.video_codec }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if metadata.studios %}
|
||||
<div class="col-12">
|
||||
<dt class="small text-muted">Studio</dt>
|
||||
<dd class="small text-dark">{{ metadata.studios|join(', ') }}</dd>
|
||||
{% if movie.audio_codec %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Audio Codec</small>
|
||||
<span class="fw-medium">{{ movie.audio_codec }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
{% if movie.resolution %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Resolution</small>
|
||||
<span class="fw-medium">{{ movie.resolution }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.bitrate %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Bitrate</small>
|
||||
<span class="fw-medium">{{ movie.bitrate }} kbps</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.frame_rate %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Frame Rate</small>
|
||||
<span class="fw-medium">{{ movie.frame_rate }} fps</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.aspect_ratio %}
|
||||
<div class="col-6">
|
||||
<small class="text-muted d-block">Aspect Ratio</small>
|
||||
<span class="fw-medium">{{ movie.aspect_ratio }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Studio & Production -->
|
||||
{% if movie.studio or movie.production_companies %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Production</h3>
|
||||
<div class="row g-3">
|
||||
{% if movie.studio %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Studio</small>
|
||||
<span class="fw-medium">{{ movie.studio }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.production_companies %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Production Company</small>
|
||||
<span class="fw-medium">{{ movie.production_companies }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- File Information -->
|
||||
{% if movie.file_path or movie.duration or movie.created_at %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">File Information</h3>
|
||||
<div class="row g-3">
|
||||
{% if movie.file_path %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">File Path</small>
|
||||
<span class="fw-medium small" style="word-break: break-all;">{{ movie.file_path }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.duration %}
|
||||
<div class="col-md-3">
|
||||
<small class="text-muted d-block">Duration</small>
|
||||
<span class="fw-medium">{{ movie.duration }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.created_at %}
|
||||
<div class="col-md-3">
|
||||
<small class="text-muted d-block">Added</small>
|
||||
<span class="fw-medium">{{ movie.created_at|date('M j, Y') }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Streaming & Availability -->
|
||||
{% if movie.streaming_providers or movie.availability %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Availability</h3>
|
||||
<div class="row g-3">
|
||||
{% if movie.streaming_providers %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Streaming Platforms</small>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for provider in movie.streaming_providers %}
|
||||
<span class="badge bg-success">{{ provider }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.availability %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block">Availability Status</small>
|
||||
<span class="fw-medium">{{ movie.availability }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Metadata (for debugging/advanced users) -->
|
||||
{% if metadata %}
|
||||
<div class="mt-4 pt-4 border-top">
|
||||
@@ -192,7 +356,7 @@
|
||||
<svg class="me-2 group-open:rotate-90 transition-transform" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
Technical Details
|
||||
Technical Details & Metadata
|
||||
</summary>
|
||||
<div class="mt-3 small">
|
||||
<pre class="bg-light p-3 rounded"><code>{{ metadata|json_encode(constant('JSON_PRETTY_PRINT')) }}</code></pre>
|
||||
|
||||
@@ -172,6 +172,211 @@
|
||||
<p class="text-sm text-gray-600">{{ version.description }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Playnite Rich Metadata -->
|
||||
{% set playniteGenres = version.genres_json|json_decode %}
|
||||
{% if playniteGenres %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Genres</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for genre in playniteGenres %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800">
|
||||
{{ genre.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set playniteTags = version.tags_json|json_decode %}
|
||||
{% if playniteTags %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Tags</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for tag in playniteTags|slice(0, 20) %}
|
||||
<span class="inline-flex items-center px-2 py-1 rounded text-sm font-medium bg-gray-100 text-gray-800">
|
||||
{{ tag.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
{% if playniteTags|length > 20 %}
|
||||
<span class="text-sm text-gray-500">+{{ playniteTags|length - 20 }} more</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set playniteFeatures = version.features_json|json_decode %}
|
||||
{% if playniteFeatures %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Features</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for feature in playniteFeatures %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800">
|
||||
{{ feature.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set playniteLinks = version.links_json|json_decode %}
|
||||
{% if playniteLinks %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Links</h3>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3">
|
||||
{% for link in playniteLinks %}
|
||||
<a href="{{ link.Url }}" target="_blank" rel="noopener noreferrer"
|
||||
class="inline-flex items-center px-3 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 transition-colors duration-200">
|
||||
<svg class="w-4 h-4 mr-2 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"/>
|
||||
<path d="M5 5a2 2 0 00-2 2v6a2 2 0 002 2h6a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"/>
|
||||
</svg>
|
||||
{{ link.Name }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set playniteSeries = version.series_json|json_decode %}
|
||||
{% if playniteSeries %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Series</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for series in playniteSeries %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800">
|
||||
{{ series.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set playniteAgeRatings = version.age_ratings_json|json_decode %}
|
||||
{% if playniteAgeRatings %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Age Ratings</h3>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% for ageRating in playniteAgeRatings %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-yellow-100 text-yellow-800">
|
||||
{{ ageRating.Name }}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Enhanced Ratings Display -->
|
||||
{% if version.critic_score or version.community_score or version.user_score %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Ratings</h3>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
||||
{% if version.critic_score %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Critic Score</p>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ version.critic_score }}%</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-yellow-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if version.community_score %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Community Score</p>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ version.community_score }}%</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-blue-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if version.user_score %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">User Score</p>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ version.user_score }}%</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-green-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Playnite-specific Statistics -->
|
||||
{% if version.play_count or version.install_size or version.completion_status %}
|
||||
<div class="mt-6">
|
||||
<h3 class="text-lg font-medium text-gray-900 mb-3">Playnite Statistics</h3>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
|
||||
{% if version.play_count %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Play Count</p>
|
||||
<p class="text-2xl font-bold text-gray-900">{{ version.play_count }}</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-indigo-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if version.install_size %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Install Size</p>
|
||||
<p class="text-lg font-bold text-gray-900">{{ (version.install_size / 1024 / 1024 / 1024)|round(1) }} GB</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M3 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 4a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if version.completion_status %}
|
||||
<div class="bg-gray-50 rounded-lg p-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-500">Completion Status</p>
|
||||
<p class="text-lg font-bold text-gray-900">{{ version.completion_status }}</p>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="w-8 h-8 text-green-400" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
@@ -1,179 +1,348 @@
|
||||
{% extends "layouts/app.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-0">
|
||||
<div class="container-fluid px-4 py-3">
|
||||
<!-- Back button -->
|
||||
<div class="mb-6">
|
||||
<a href="{{ path_for('movies.index') }}" class="inline-flex items-center text-sm text-indigo-600 hover:text-indigo-800">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<div class="mb-4">
|
||||
<a href="{{ path_for('movies.index') }}" class="btn btn-link text-decoration-none p-0">
|
||||
<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 Movies
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="bg-white shadow rounded-lg overflow-hidden">
|
||||
<div class="md:flex">
|
||||
<div class="card shadow-sm">
|
||||
<div class="row g-0">
|
||||
<!-- Movie poster -->
|
||||
<div class="md:w-1/3 p-6">
|
||||
<div class="aspect-[2/3] bg-gray-200 rounded-lg overflow-hidden">
|
||||
{% if movie.poster_url %}
|
||||
<img src="{{ movie.poster_url }}" alt="{{ movie.title }}" class="w-full h-full object-cover">
|
||||
{% else %}
|
||||
<div class="w-full h-full flex items-center justify-center bg-gray-100">
|
||||
<svg class="h-24 w-24 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2h4a1 1 0 010 2h-1v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6H3a1 1 0 010-2h4z"/>
|
||||
</svg>
|
||||
<div class="col-md-4">
|
||||
<div class="card-body p-4">
|
||||
<div class="ratio ratio-2x3">
|
||||
{% if movie.poster_url %}
|
||||
<img src="/images/{{ movie.poster_url }}" alt="{{ movie.title }}" class="img-fluid rounded">
|
||||
{% else %}
|
||||
<div class="w-100 h-100 d-flex align-items-center justify-content-center bg-light rounded">
|
||||
<svg class="text-muted" width="96" height="96" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2h4a1 1 0 010 2h-1v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6H3a1 1 0 010-2h4z"/>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="mt-4 d-grid gap-2">
|
||||
<button class="btn btn-primary">
|
||||
<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="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-6 8a9 9 0 110-18 9 9 0 010 18z"/>
|
||||
</svg>
|
||||
Mark as Watched
|
||||
</button>
|
||||
<button class="btn btn-outline-danger">
|
||||
<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="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
|
||||
</svg>
|
||||
Add to Favorites
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Movie details -->
|
||||
<div class="md:w-2/3 p-6">
|
||||
<div class="mb-6">
|
||||
<h1 class="text-3xl font-bold text-gray-900 mb-2">{{ movie.title }}</h1>
|
||||
|
||||
<!-- Movie metadata -->
|
||||
<div class="flex flex-wrap gap-4 text-sm text-gray-600 mb-4">
|
||||
{% if movie.release_date %}
|
||||
<span class="flex items-center">
|
||||
<svg class="w-4 h-4 mr-1" 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>
|
||||
{{ movie.release_date|date('Y') }}
|
||||
</span>
|
||||
<div class="col-md-8">
|
||||
<div class="card-body p-4">
|
||||
<div class="mb-4">
|
||||
<h1 class="display-4 fw-bold text-dark mb-2">{{ movie.title }}</h1>
|
||||
{% if movie.tagline %}
|
||||
<p class="lead text-muted mb-3">{{ movie.tagline }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.rating %}
|
||||
<span class="flex items-center">
|
||||
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
{{ movie.rating }}/10
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.runtime_minutes %}
|
||||
<span class="flex items-center">
|
||||
<svg class="w-4 h-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
{{ (movie.runtime_minutes / 60)|round(1) }}h {{ movie.runtime_minutes % 60 }}m
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="flex items-center">
|
||||
<svg class="w-4 h-4 mr-1" 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>
|
||||
{{ movie.source_name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Status badges -->
|
||||
<div class="flex flex-wrap gap-2">
|
||||
{% if movie.watched %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800">
|
||||
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
Watched
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.watch_count > 0 %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800">
|
||||
{{ movie.watch_count }} watch{{ movie.watch_count > 1 ? 'es' : '' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.is_favorite %}
|
||||
<span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-red-100 text-red-800">
|
||||
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"/>
|
||||
</svg>
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Overview -->
|
||||
{% if movie.overview %}
|
||||
<div class="mb-6">
|
||||
<h2 class="text-lg font-semibold text-gray-900 mb-2">Overview</h2>
|
||||
<p class="text-gray-700 leading-relaxed">{{ movie.overview }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Additional details -->
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<!-- Cast & Crew -->
|
||||
{% if movie.cast or movie.director or movie.writer %}
|
||||
<div>
|
||||
<h3 class="text-md font-semibold text-gray-900 mb-3">Cast & Crew</h3>
|
||||
<dl class="space-y-2">
|
||||
{% if movie.director %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Director</dt>
|
||||
<dd class="text-sm text-gray-900">{{ movie.director }}</dd>
|
||||
</div>
|
||||
<!-- Movie metadata -->
|
||||
<div class="d-flex flex-wrap gap-3 small text-muted mb-3">
|
||||
{% if movie.release_date %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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>
|
||||
{{ movie.release_date|date('Y') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if movie.writer %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Writer</dt>
|
||||
<dd class="text-sm text-gray-900">{{ movie.writer }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.cast %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Cast</dt>
|
||||
<dd class="text-sm text-gray-900">{{ movie.cast }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Genres & Studios -->
|
||||
{% if movie.genre or metadata.studios %}
|
||||
<div>
|
||||
<h3 class="text-md font-semibold text-gray-900 mb-3">Details</h3>
|
||||
<dl class="space-y-2">
|
||||
{% if movie.genre %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Genre</dt>
|
||||
<dd class="text-sm text-gray-900">{{ movie.genre }}</dd>
|
||||
</div>
|
||||
{% if movie.rating %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
{{ movie.rating }}/10
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if metadata.studios %}
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Studio</dt>
|
||||
<dd class="text-sm text-gray-900">{{ metadata.studios|join(', ') }}</dd>
|
||||
</div>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Metadata (for debugging/advanced users) -->
|
||||
{% if metadata %}
|
||||
<div class="mt-6 pt-6 border-t border-gray-200">
|
||||
<details class="group">
|
||||
<summary class="cursor-pointer text-sm font-medium text-gray-700 hover:text-gray-900 flex items-center">
|
||||
<svg class="w-4 h-4 mr-2 group-open:rotate-90 transition-transform" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
Technical Details
|
||||
</summary>
|
||||
<div class="mt-4 text-sm">
|
||||
<pre class="bg-gray-50 p-4 rounded-lg overflow-x-auto">{{ metadata|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre>
|
||||
{% if movie.runtime_minutes %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
{{ (movie.runtime_minutes / 60)|round(1) }}h {{ movie.runtime_minutes % 60 }}m
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.vote_count %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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>
|
||||
{{ movie.vote_count }} votes
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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>
|
||||
{{ movie.source_name }}
|
||||
</span>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- Status badges -->
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% if movie.watched %}
|
||||
<span class="badge bg-success d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
|
||||
</svg>
|
||||
Watched
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.watch_count > 0 %}
|
||||
<span class="badge bg-primary">{{ movie.watch_count }} watch{{ movie.watch_count > 1 ? 'es' : '' }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.is_favorite %}
|
||||
<span class="badge bg-danger d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"/>
|
||||
</svg>
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.status %}
|
||||
<span class="badge bg-secondary">{{ movie.status|title }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Overview -->
|
||||
{% if movie.overview %}
|
||||
<div class="mb-4">
|
||||
<h2 class="h5 fw-semibold text-dark mb-2">Overview</h2>
|
||||
<p class="text-muted">{{ movie.overview }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Cast & Crew Section -->
|
||||
<div class="mb-4">
|
||||
<h2 class="h5 fw-semibold text-dark mb-3">Cast & Crew</h2>
|
||||
<div class="row g-3">
|
||||
{% if movie.director %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg class="me-2 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>
|
||||
<small class="text-muted d-block">Director</small>
|
||||
<span class="fw-medium">{{ movie.director }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.writer %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg class="me-2 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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/>
|
||||
</svg>
|
||||
<div>
|
||||
<small class="text-muted d-block">Writer</small>
|
||||
<span class="fw-medium">{{ movie.writer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if actors %}
|
||||
<div class="mt-3">
|
||||
<small class="text-muted d-block mb-2">Cast</small>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for actor in actors %}
|
||||
<span class="badge bg-light text-dark">{{ actor.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Movie Details Grid -->
|
||||
<div class="row g-4 mb-4">
|
||||
<!-- Genres -->
|
||||
{% if movie.genre %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Genres</h3>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for genre in movie.genre|split(',') %}
|
||||
<span class="badge bg-primary">{{ genre|trim }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Production -->
|
||||
{% if movie.production_companies or movie.production_countries %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Production</h3>
|
||||
<div class="mb-2">
|
||||
{% if movie.production_companies %}
|
||||
<small class="text-muted d-block">Companies</small>
|
||||
<span class="fw-medium">{{ movie.production_companies }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if movie.production_countries %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Countries</small>
|
||||
<span class="fw-medium">{{ movie.production_countries }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Technical Details -->
|
||||
{% if movie.budget or movie.revenue or movie.original_language %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Technical</h3>
|
||||
<div class="mb-2">
|
||||
{% if movie.budget %}
|
||||
<small class="text-muted d-block">Budget</small>
|
||||
<span class="fw-medium">${{ movie.budget|number_format(0, '.', ',') }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if movie.revenue %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Revenue</small>
|
||||
<span class="fw-medium">${{ movie.revenue|number_format(0, '.', ',') }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if movie.original_language %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Language</small>
|
||||
<span class="fw-medium">{{ movie.original_language|upper }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Collection/Series Info -->
|
||||
{% if movie.belongs_to_collection %}
|
||||
<div class="mb-4 p-3 bg-light rounded">
|
||||
<h3 class="h6 fw-semibold text-dark mb-2">Collection</h3>
|
||||
<span class="fw-medium">{{ movie.belongs_to_collection }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Streaming & Availability -->
|
||||
{% if movie.streaming_providers or movie.availability %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h5 fw-semibold text-dark mb-3">Where to Watch</h3>
|
||||
<div class="row g-3">
|
||||
{% if movie.streaming_providers %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block mb-2">Streaming</small>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for provider in movie.streaming_providers %}
|
||||
<span class="badge bg-success">{{ provider }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.availability %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block mb-2">Availability</small>
|
||||
<span class="fw-medium">{{ movie.availability }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- User Reviews & Ratings -->
|
||||
{% if movie.user_reviews or movie.critic_reviews %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h5 fw-semibold text-dark mb-3">Reviews & Ratings</h3>
|
||||
<div class="row g-4">
|
||||
{% if movie.user_reviews %}
|
||||
<div class="col-md-6">
|
||||
<h4 class="h6 fw-semibold text-dark mb-2">User Reviews</h4>
|
||||
<div class="vstack gap-3">
|
||||
{% for review in movie.user_reviews[:3] %}
|
||||
<div class="p-3 bg-light rounded">
|
||||
<div class="d-flex align-items-center mb-2">
|
||||
<div class="d-flex text-warning">
|
||||
{% for i in 1..5 %}
|
||||
<svg class="me-1" width="16" height="16" fill="{{ i <= review.rating ? 'currentColor' : 'none' }}" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<span class="ms-2 small text-muted">{{ review.author }}</span>
|
||||
</div>
|
||||
<p class="small text-muted">{{ review.content|slice(0, 150) }}{% if review.content|length > 150 %}...{% endif %}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if movie.critic_reviews %}
|
||||
<div class="col-md-6">
|
||||
<h4 class="h6 fw-semibold text-dark mb-2">Critic Reviews</h4>
|
||||
<div class="vstack gap-3">
|
||||
{% for review in movie.critic_reviews[:3] %}
|
||||
<div class="p-3 bg-light rounded">
|
||||
<div class="d-flex align-items-center justify-content-between mb-2">
|
||||
<span class="fw-medium">{{ review.publication }}</span>
|
||||
<span class="badge bg-info">{{ review.rating }}/100</span>
|
||||
</div>
|
||||
<p class="small text-muted">{{ review.excerpt|slice(0, 150) }}{% if review.excerpt|length > 150 %}...{% endif %}</p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Metadata (for debugging/advanced users) -->
|
||||
{% if metadata %}
|
||||
<div class="mt-4 pt-4 border-top">
|
||||
<details class="group">
|
||||
<summary class="cursor-pointer small fw-medium text-muted hover:text-dark d-flex align-items-center">
|
||||
<svg class="me-2 group-open:rotate-90 transition-transform" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
Technical Details & Metadata
|
||||
</summary>
|
||||
<div class="mt-3 small">
|
||||
<pre class="bg-light p-3 rounded"><code>{{ metadata|json_encode(constant('JSON_PRETTY_PRINT')) }}</code></pre>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,30 +1,381 @@
|
||||
{% extends "layouts/app.twig" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="px-4 py-6 sm:px-0">
|
||||
<div class="container-fluid px-4 py-3">
|
||||
<!-- Back button -->
|
||||
<div class="mb-6">
|
||||
<a href="{{ path_for('tvshows.index') }}" class="inline-flex items-center text-sm text-indigo-600 hover:text-indigo-800">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<div class="mb-4">
|
||||
<a href="{{ path_for('tvshows.index') }}" class="btn btn-link text-decoration-none p-0">
|
||||
<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 TV Shows
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Coming Soon Message -->
|
||||
<div class="text-center py-12">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400" 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>
|
||||
<h3 class="mt-2 text-sm font-medium text-gray-900">TV Show Details Coming Soon</h3>
|
||||
<p class="mt-1 text-sm text-gray-500">{{ message }}</p>
|
||||
<div class="mt-6">
|
||||
<div class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white">
|
||||
<svg class="w-4 h-4 mr-2" 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>
|
||||
TV Show ID: {{ tvshow.id }}
|
||||
<div class="card shadow-sm">
|
||||
<div class="row g-0">
|
||||
<!-- TV Show poster -->
|
||||
<div class="col-md-4">
|
||||
<div class="card-body p-4">
|
||||
<div class="ratio ratio-2x3">
|
||||
{% if tvshow.poster_url %}
|
||||
<img src="/images/{{ tvshow.poster_url }}" alt="{{ tvshow.title }}" class="img-fluid rounded">
|
||||
{% else %}
|
||||
<div class="w-100 h-100 d-flex align-items-center justify-content-center bg-light rounded">
|
||||
<svg class="text-muted" width="96" height="96" 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>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="mt-4 d-grid gap-2">
|
||||
<button class="btn btn-primary">
|
||||
<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="M14.828 14.828a4 4 0 01-5.656 0M9 10h1m4 0h1m-6 8a9 9 0 110-18 9 9 0 010 18z"/>
|
||||
</svg>
|
||||
Mark as Watched
|
||||
</button>
|
||||
<button class="btn btn-outline-danger">
|
||||
<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="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
|
||||
</svg>
|
||||
Add to Favorites
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TV Show details -->
|
||||
<div class="col-md-8">
|
||||
<div class="card-body p-4">
|
||||
<div class="mb-4">
|
||||
<h1 class="display-4 fw-bold text-dark mb-2">{{ tvshow.title }}</h1>
|
||||
{% if tvshow.tagline %}
|
||||
<p class="lead text-muted mb-3">{{ tvshow.tagline }}</p>
|
||||
{% endif %}
|
||||
|
||||
<!-- TV Show metadata -->
|
||||
<div class="d-flex flex-wrap gap-3 small text-muted mb-3">
|
||||
{% if tvshow.first_air_date %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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>
|
||||
{{ tvshow.first_air_date|date('Y') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.last_air_date %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
||||
</svg>
|
||||
Ended {{ tvshow.last_air_date|date('Y') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.vote_average %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
{{ tvshow.vote_average }}/10
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.number_of_seasons and tvshow.number_of_episodes %}
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 4V2a1 1 0 011-1h8a1 1 0 011 1v2h4a1 1 0 010 2h-1v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6H3a1 1 0 010-2h4z"/>
|
||||
</svg>
|
||||
{{ tvshow.number_of_seasons }} season{{ tvshow.number_of_seasons > 1 ? 's' : '' }}, {{ tvshow.number_of_episodes }} episode{{ tvshow.number_of_episodes > 1 ? 's' : '' }}
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
<span class="d-flex align-items-center">
|
||||
<svg class="me-1" width="16" height="16" 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>
|
||||
{{ tvshow.source_name }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Status badges -->
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% if tvshow.status == 'Ended' %}
|
||||
<span class="badge bg-danger d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"/>
|
||||
</svg>
|
||||
Ended
|
||||
</span>
|
||||
{% elseif tvshow.status == 'Returning Series' %}
|
||||
<span class="badge bg-success d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
|
||||
</svg>
|
||||
Ongoing
|
||||
</span>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.is_favorite %}
|
||||
<span class="badge bg-warning text-dark d-flex align-items-center">
|
||||
<svg class="me-1" width="12" height="12" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"/>
|
||||
</svg>
|
||||
Favorite
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Overview -->
|
||||
{% if tvshow.overview %}
|
||||
<div class="mb-4">
|
||||
<h2 class="h5 fw-semibold text-dark mb-2">Overview</h2>
|
||||
<p class="text-muted">{{ tvshow.overview }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Cast & Crew Section -->
|
||||
<div class="mb-4">
|
||||
<h2 class="h5 fw-semibold text-dark mb-3">Cast & Crew</h2>
|
||||
<div class="row g-3">
|
||||
{% if tvshow.created_by %}
|
||||
<div class="col-md-6">
|
||||
<div class="d-flex align-items-center">
|
||||
<svg class="me-2 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>
|
||||
<small class="text-muted d-block">Created by</small>
|
||||
<span class="fw-medium">{{ tvshow.created_by }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if actors %}
|
||||
<div class="mt-3">
|
||||
<small class="text-muted d-block mb-2">Main Cast</small>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for actor in actors %}
|
||||
<span class="badge bg-light text-dark">{{ actor.name }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- TV Show Details Grid -->
|
||||
<div class="row g-4 mb-4">
|
||||
<!-- Genres -->
|
||||
{% if tvshow.genre %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Genres</h3>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for genre in tvshow.genre|split(',') %}
|
||||
<span class="badge bg-primary">{{ genre|trim }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Networks & Production -->
|
||||
{% if tvshow.networks or tvshow.production_companies %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Production</h3>
|
||||
<div class="mb-2">
|
||||
{% if tvshow.networks %}
|
||||
<small class="text-muted d-block">Networks</small>
|
||||
<span class="fw-medium">{{ tvshow.networks }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if tvshow.production_companies %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Companies</small>
|
||||
<span class="fw-medium">{{ tvshow.production_companies }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Episode Details -->
|
||||
{% if tvshow.episode_run_time or tvshow.origin_country %}
|
||||
<div class="col-md-4">
|
||||
<h3 class="h6 fw-semibold text-dark mb-3">Details</h3>
|
||||
<div class="mb-2">
|
||||
{% if tvshow.episode_run_time %}
|
||||
<small class="text-muted d-block">Episode Runtime</small>
|
||||
<span class="fw-medium">{{ tvshow.episode_run_time }} minutes</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if tvshow.origin_country %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Origin Country</small>
|
||||
<span class="fw-medium">{{ tvshow.origin_country }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if tvshow.original_language %}
|
||||
<div class="mb-2">
|
||||
<small class="text-muted d-block">Language</small>
|
||||
<span class="fw-medium">{{ tvshow.original_language|upper }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Seasons Section -->
|
||||
{% if seasons %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h5 fw-semibold text-dark mb-3">Seasons</h3>
|
||||
<div class="accordion" id="seasonsAccordion">
|
||||
{% for season in seasons %}
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="heading{{ season.season_number }}">
|
||||
<button class="accordion-button {% if loop.first %}collapsed{% else %}collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{ season.season_number }}" aria-expanded="{% if loop.first %}true{% else %}false{% endif %}" aria-controls="collapse{{ season.season_number }}">
|
||||
<div class="d-flex justify-content-between w-100">
|
||||
<span>Season {{ season.season_number }}</span>
|
||||
<span class="text-muted">{{ season.episode_count }} episodes</span>
|
||||
</div>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="collapse{{ season.season_number }}" class="accordion-collapse collapse {% if loop.first %}show{% endif %}" aria-labelledby="heading{{ season.season_number }}" data-bs-parent="#seasonsAccordion">
|
||||
<div class="accordion-body">
|
||||
{% if season.episodes %}
|
||||
<div class="list-group list-group-flush">
|
||||
{% for episode in season.episodes %}
|
||||
<div class="list-group-item d-flex align-items-center py-3">
|
||||
<div class="flex-shrink-0 me-3">
|
||||
{% if episode.poster_url %}
|
||||
<img src="/images/{{ episode.poster_url }}" alt="{{ episode.title }}" class="rounded" style="width: 60px; height: 34px; object-fit: cover;">
|
||||
{% else %}
|
||||
<div class="rounded d-flex align-items-center justify-content-center bg-light" style="width: 60px; height: 34px;">
|
||||
<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="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="flex-grow-1">
|
||||
<div class="d-flex align-items-center gap-2 mb-1">
|
||||
<span class="badge bg-info">E{{ episode.episode_number }}</span>
|
||||
{% if episode.air_date %}
|
||||
<span class="small text-muted">{{ episode.air_date|date('M j, Y') }}</span>
|
||||
{% endif %}
|
||||
{% if episode.is_watched %}
|
||||
<span class="badge bg-success">Watched</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<h6 class="mb-1">{{ episode.title }}</h6>
|
||||
{% if episode.overview %}
|
||||
<p class="small text-muted mb-0">{{ episode.overview|slice(0, 100) }}{% if episode.overview|length > 100 %}...{% endif %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="text-muted">No episodes available.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Recent Episodes -->
|
||||
{% if recent_episodes %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h5 fw-semibold text-dark mb-3">Recent Episodes</h3>
|
||||
<div class="vstack gap-3">
|
||||
{% for episode in recent_episodes[:5] %}
|
||||
<div class="card border-0 bg-light">
|
||||
<div class="card-body p-3">
|
||||
<div class="d-flex">
|
||||
<div class="flex-shrink-0 me-3">
|
||||
{% if episode.still_url %}
|
||||
<img src="/images/{{ episode.still_url }}" alt="{{ episode.title }}" class="rounded" style="width: 120px; height: 68px; object-fit: cover;">
|
||||
{% else %}
|
||||
<div class="rounded d-flex align-items-center justify-content-center bg-secondary" style="width: 120px; height: 68px;">
|
||||
<svg class="text-white" width="32" height="32" 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="flex-grow-1">
|
||||
<div class="d-flex align-items-center gap-2 mb-1">
|
||||
<span class="badge bg-info">S{{ episode.season_number }}E{{ episode.episode_number }}</span>
|
||||
<span class="small text-muted">{{ episode.air_date|date('M j, Y') }}</span>
|
||||
</div>
|
||||
<h6 class="fw-medium mb-1">{{ episode.title }}</h6>
|
||||
{% if episode.vote_average %}
|
||||
<div class="d-flex align-items-center small text-muted">
|
||||
<svg class="me-1 text-warning" width="14" height="14" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"/>
|
||||
</svg>
|
||||
{{ episode.vote_average }}/10
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Streaming & Availability -->
|
||||
{% if tvshow.streaming_providers or tvshow.availability %}
|
||||
<div class="mb-4">
|
||||
<h3 class="h5 fw-semibold text-dark mb-3">Where to Watch</h3>
|
||||
<div class="row g-3">
|
||||
{% if tvshow.streaming_providers %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block mb-2">Streaming</small>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
{% for provider in tvshow.streaming_providers %}
|
||||
<span class="badge bg-success">{{ provider }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if tvshow.availability %}
|
||||
<div class="col-md-6">
|
||||
<small class="text-muted d-block mb-2">Availability</small>
|
||||
<span class="fw-medium">{{ tvshow.availability }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Metadata (for debugging/advanced users) -->
|
||||
{% if metadata %}
|
||||
<div class="mt-4 pt-4 border-top">
|
||||
<details class="group">
|
||||
<summary class="cursor-pointer small fw-medium text-muted hover:text-dark d-flex align-items-center">
|
||||
<svg class="me-2 group-open:rotate-90 transition-transform" width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
|
||||
</svg>
|
||||
Technical Details & Metadata
|
||||
</summary>
|
||||
<div class="mt-3 small">
|
||||
<pre class="bg-light p-3 rounded"><code>{{ metadata|json_encode(constant('JSON_PRETTY_PRINT')) }}</code></pre>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user