player fullscreen

This commit is contained in:
Ske087
2025-02-01 21:40:46 +02:00
parent 85a23eeca8
commit 482fe55137
10 changed files with 29 additions and 42 deletions

Binary file not shown.

14
app.py
View File

@@ -481,8 +481,11 @@ def upload_personalization_pictures():
def clean_unused_files():
# Get all file names from the database
content_files = {content.file_name for content in Content.query.all()}
logo_file = 'logo.png'
login_picture_file = 'login_picture.png'
logo_file = 'resurse/logo.png'
login_picture_file = 'resurse/login_picture.png'
# Debugging: Print the content files from the database
print("Content files from database:", content_files)
# Get all files in the upload folder
all_files = set(os.listdir(app.config['UPLOAD_FOLDER']))
@@ -491,15 +494,22 @@ def clean_unused_files():
used_files = content_files | {logo_file, login_picture_file}
unused_files = all_files - used_files
# Debugging: Print the lists of files
print("All files:", all_files)
print("Used files:", used_files)
print("Unused files:", unused_files)
# Delete unused files
for file_name in unused_files:
file_path = os.path.join(app.config['UPLOAD_FOLDER'], file_name)
if os.path.isfile(file_path):
print(f"Deleting file: {file_path}") # Debugging: Print the file being deleted
os.remove(file_path)
flash('Unused files have been cleaned.', 'success')
return redirect(url_for('admin'))
@app.context_processor
def inject_theme():
if current_user.is_authenticated:

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

BIN
static/uploads/Ibex_450.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

View File

@@ -24,7 +24,7 @@
<div class="container py-5">
<div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
<img src="{{ url_for('static', filename='resurse/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Dashboard</h1>
</div>

View File

@@ -54,25 +54,6 @@
</div>
</div>
<!-- Add Player Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header">
<h2>Add Player</h2>
</div>
<div class="card-body">
<form action="{{ url_for('add_player') }}" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Add Player</button>
</form>
</div>
</div>
<!-- Groups Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">

View File

@@ -16,7 +16,7 @@
<div class="row">
<div class="col-md-6 text-center">
{% if login_picture_exists %}
<img src="{{ url_for('static', filename='uploads/login_picture.png') }}" alt="Login Picture" class="login-picture">
<img src="{{ url_for('static', filename='resurse/login_picture.png') }}" alt="Login Picture" class="login-picture">
{% endif %}
</div>
<div class="col-md-6">

View File

@@ -25,7 +25,7 @@
<div class="container py-5">
<div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
<img src="{{ url_for('static', filename='resurse/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Manage Group: {{ group.name }}</h1>
</div>

View File

@@ -1,24 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title>Player Fullscreen Schedule</title>
<title>Player Fullscreen</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body, html {
height: 100%;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
body {
background-color: black;
margin: 0;
overflow: hidden;
}
img, video, embed, object {
max-width: 100%;
max-height: 100%;
width: 100%;
height: 100%;
.content-item {
display: none;
width: 100vw;
height: 100vh;
object-fit: cover;
}
.active {
.content-item.active {
display: block;
}
</style>
@@ -32,14 +29,13 @@
Your browser does not support the video tag.
</video>
{% elif item.file_name.endswith('.pdf') %}
<object data="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="application/pdf" class="content-item" data-duration="{{ item.duration }}">
<embed src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="application/pdf" class="content-item" data-duration="{{ item.duration }}">
</object>
<object data="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="application/pdf" class="content-item" data-duration="{{ item.duration }}"></object>
{% else %}
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" class="content-item" data-duration="{{ item.duration }}">
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" class="content-item" data-duration="{{ item.duration }}" alt="{{ item.file_name }}">
{% endif %}
{% endfor %}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const items = document.querySelectorAll('.content-item');