aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-07-31 20:28:38 +0200
committermetamuffin <metamuffin@disroot.org>2023-07-31 20:28:38 +0200
commit30306bcf5a312c8749b1b66ef0a426cf7aaee989 (patch)
tree74836ccee827589b3606c65f8502e4e6ef13d880
parentaeafba7847e189313df3025e6d6f291999b57350 (diff)
downloadjellything-30306bcf5a312c8749b1b66ef0a426cf7aaee989.tar
jellything-30306bcf5a312c8749b1b66ef0a426cf7aaee989.tar.bz2
jellything-30306bcf5a312c8749b1b66ef0a426cf7aaee989.tar.zst
images loading again
-rw-r--r--remuxer/src/import/mod.rs7
-rw-r--r--server/src/routes/ui/assets.rs2
-rw-r--r--server/src/routes/ui/browser.rs27
-rw-r--r--tools/src/bin/import.rs2
4 files changed, 27 insertions, 11 deletions
diff --git a/remuxer/src/import/mod.rs b/remuxer/src/import/mod.rs
index 1af74f6..8df9f42 100644
--- a/remuxer/src/import/mod.rs
+++ b/remuxer/src/import/mod.rs
@@ -258,7 +258,12 @@ fn import_read_segment(
}
for i in 0..iteminfo.len() {
- seek_index_out.push(seek_index.get(&(i as u64)).unwrap().clone())
+ seek_index_out.push(
+ seek_index
+ .get(&(i as u64))
+ .map(|e| e.to_owned())
+ .unwrap_or_else(|| SeekIndex { blocks: vec![] }),
+ )
}
Ok(if let Some(duration) = duration {
diff --git a/server/src/routes/ui/assets.rs b/server/src/routes/ui/assets.rs
index 2c0b85a..27d322a 100644
--- a/server/src/routes/ui/assets.rs
+++ b/server/src/routes/ui/assets.rs
@@ -28,7 +28,7 @@ pub async fn r_item_assets(
db: &State<Database>,
) -> Result<(ContentType, CacheControlFile), MyError> {
let node = db.node.get(&id)?.ok_or(anyhow!("node does not exist"))?;
- let path = CONF.asset_path.join(
+ let path = CONF.library_path.join(
match role {
AssetRole::Backdrop => node.private.backdrop,
AssetRole::Poster => node.private.poster,
diff --git a/server/src/routes/ui/browser.rs b/server/src/routes/ui/browser.rs
index 767e411..e7f7d96 100644
--- a/server/src/routes/ui/browser.rs
+++ b/server/src/routes/ui/browser.rs
@@ -3,24 +3,35 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
-use super::{account::session::Session, error::MyError, layout::DynLayoutPage};
+use super::{account::session::Session, error::MyError, layout::DynLayoutPage, node::PosterCard};
use crate::database::Database;
+use anyhow::Context;
+use jellycommon::{Node, NodeKind};
use rocket::{get, State};
#[get("/items")]
pub fn r_all_items(_sess: Session, db: &State<Database>) -> Result<DynLayoutPage<'_>, MyError> {
+ let items = db
+ .node
+ .iter()
+ .map(|e| e.context("listing"))
+ .collect::<anyhow::Result<Vec<_>>>()?
+ .into_iter()
+ .filter(|(_, n)| matches!(n.public.kind, NodeKind::Movie | NodeKind::Series))
+ .collect::<Vec<(String, Node)>>();
+
Ok(super::layout::LayoutPage {
title: "All Items".to_owned(),
content: markup::new! {
.page.dir {
h1 { "All Items" }
- // ul.directorylisting { @for item in &items {
- // li {@PosterCard {
- // wide: false, dir: false,
- // path: item.lib_path.clone(),
- // title: &item.info.title
- // }}
- // }}
+ ul.directorylisting { @for (id, node) in &items {
+ li {@PosterCard {
+ wide: false, dir: false,
+ id,
+ title: &node.public.title
+ }}
+ }}
}
},
..Default::default()
diff --git a/tools/src/bin/import.rs b/tools/src/bin/import.rs
index f740fec..1fff206 100644
--- a/tools/src/bin/import.rs
+++ b/tools/src/bin/import.rs
@@ -175,7 +175,7 @@ fn main() -> anyhow::Result<()> {
let f = File::create(path.join(if series {
"directory.json".to_string()
} else {
- format!("{ident}.jelly",)
+ format!("{ident}.jelly")
}))?;
serde_json::to_writer_pretty(f, &node)?;
}