some fixes for album html rendering

This commit is contained in:
Nick Pegg 2025-05-06 18:49:28 -07:00
parent 9434eb835d
commit 53a6c34785
4 changed files with 28 additions and 26 deletions

View file

@ -45,12 +45,14 @@ impl AlbumDir {
let _conents = fs::read_to_string(entry_path)?;
// TODO: render markdown
todo!();
} else if filename.to_string_lossy().starts_with("cover") {
cover = Some(Image::new(
entry_path.strip_prefix(&root)?.to_path_buf(),
String::new(),
)?);
} else {
if filename.to_string_lossy().starts_with("cover") {
cover = Some(Image::new(
entry_path.strip_prefix(&root)?.to_path_buf(),
String::new(),
)?);
}
let reader = ImageReader::open(&entry_path)?.with_guessed_format()?;
if reader.format().is_some() {
// Found an image