update
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2024-12-14 23:33:47 +01:00
parent 954e660343
commit 74de914688
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 17 additions and 3 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
videos
db
target

View file

@ -1,4 +1,3 @@
version: '3'
services: services:
watchdogs: watchdogs:
build: . build: .

View file

@ -67,7 +67,7 @@ pub async fn index_page(htmx: HTMX, library: &State<Library>) -> (Status, (Conte
}; };
}; };
h1 class="text-center text-4xl font-extrabold leading-tight mt-8" { "Directories:" }; h1 class="text-center text-4xl font-extrabold leading-tight mt-8" { "Directories:" };
div class="flex p-10" { div class="flex flex-wrap p-10" {
@for dir in library.get_directories().await { @for dir in library.get_directories().await {
a class="px-3 py-2 m-2 bg-purple-500 text-white rounded-full cursor-pointer hover:bg-purple-600" href=(format!("/d/{dir}")) { (dir) }; a class="px-3 py-2 m-2 bg-purple-500 text-white rounded-full cursor-pointer hover:bg-purple-600" href=(format!("/d/{dir}")) { (dir) };
br; br;

View file

@ -8,7 +8,7 @@ use serde_json::json;
use crate::{ use crate::{
library::{self, Library}, library::{self, Library},
pages::components::video_element, pages::components::{format_date, video_element},
}; };
use super::{ use super::{
@ -44,6 +44,18 @@ pub async fn watch_page(
}; };
div class="p-4 bg-stone-900 rounded-lg shadow-lg mt-8" { div class="p-4 bg-stone-900 rounded-lg shadow-lg mt-8" {
h2 class="text-2xl font-semibold" { (video.title) }; h2 class="text-2xl font-semibold" { (video.title) };
@if let Some(meta) = video.youtube_meta().await {
div class="flex justify-between mt-2" {
p class="mb-4 text-gray-300" { (meta.uploader_name) };
p class="mb-4 text-gray-300" { (format!("{} Views ﹣ {}", meta.views, format_date(&meta.upload_date))) };
};
a href=(format!("https://www.youtube.com/watch?v={}", meta.id)) class="text-blue-400" {"Watch on YouTube" };
p class="mb-2 text-gray-300 text-bold mt-2" { "Description: " } span { (meta.description) };
};
}; };
}; };
}; };