quick update

main
oscar 3 months ago
parent 500129812f
commit a7bf98a23b

@ -16,3 +16,16 @@ def connect_redis():
except Exception as e:
print(f"An error occurred: {e}")
return None
def get_local_db_connection():
import psycopg2
from psycopg2.extras import RealDictCursor
conn = psycopg2.connect(
host='192.168.0.27',
port=5432,
dbname='streamaster',
user='oscar',
password='j0cy8c311024x3'
)
cursor = conn.cursor(cursor_factory=RealDictCursor)
return conn, cursor

@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ video.username }} - Video</title>
<style>
@ -31,16 +32,38 @@
.meta p { margin: 8px 0; }
a { color: #0af; text-decoration: none; }
</style>
<script>
function openFolder(filePath) {
fetch('/open-folder', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ file_path: filePath })
}).then(res => res.json()).then(data => {
if (data.success) {
console.log("Opened folder successfully");
} else {
alert("Failed to open folder");
}
});
}
</script>
</head>
<body>
<h1>{{ video.username }} - {{ video.site }}</h1>
<div>
<a href="/user/{{ video.username }}">⬅ Back to {{ video.username }}'s Videos</a>
</div>
<video controls muted>
<source src="/video/stream/{{ video.video_id }}" type="video/mp4">
Your browser does not support the video tag.
</video>
<div class="meta">
<button onclick="openFolder('{{ video.filepath }}')">Open Folder</button>
</div>
<div class="meta">
<p><strong>Username:</strong> {{ video.username }}</p>
<p><strong>Size:</strong> {{ "%.2f"|format(video.size/1024) }} GB</p>

Loading…
Cancel
Save