Skip to content

Commit

Permalink
Koharu: parse title from filename
Browse files Browse the repository at this point in the history
  • Loading branch information
LetrixZ committed Jul 13, 2024
1 parent 54d4e7c commit 3cd7853
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "1.1.4"
version = "1.1.5"
edition = "2021"

[dependencies]
Expand Down
8 changes: 6 additions & 2 deletions server/src/metadata/koharu.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{db, utils};
use crate::{config::CONFIG, db, utils};
use serde::Deserialize;
use slug::slugify;

Expand All @@ -22,7 +22,11 @@ pub struct Metadata {
}

pub fn add_metadata(info: Metadata, archive: &mut db::UpsertArchiveData) -> anyhow::Result<()> {
archive.title = Some(info.title);
archive.title = if CONFIG.metadata.parse_filename_title {
utils::parse_filename(&info.title).0
} else {
Some(info.title)
};
archive.slug = archive.title.as_ref().map(slugify);
archive.description = info.description;
archive.thumbnail = Some(1);
Expand Down
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-kit",
"version": "1.1.4",
"version": "1.1.5",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down

0 comments on commit 3cd7853

Please sign in to comment.