rename to little-hesinde

This commit is contained in:
Sebastian Hugentobler 2024-05-10 17:31:27 +02:00
parent 155e09b159
commit fd7f551726
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0
52 changed files with 54 additions and 47 deletions

46
Cargo.lock generated
View File

@ -837,6 +837,29 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "little-hesinde"
version = "0.1.0"
dependencies = [
"calibre-db",
"clap",
"once_cell",
"poem",
"quick-xml",
"rust-embed",
"serde",
"serde_json",
"serde_with",
"tera",
"thiserror",
"time",
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
"uuid",
]
[[package]]
name = "lock_api"
version = "0.4.12"
@ -1354,29 +1377,6 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rusty-library"
version = "0.1.0"
dependencies = [
"calibre-db",
"clap",
"once_cell",
"poem",
"quick-xml",
"rust-embed",
"serde",
"serde_json",
"serde_with",
"tera",
"thiserror",
"time",
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
"uuid",
]
[[package]]
name = "ryu"
version = "1.0.17"

View File

@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
"calibre-db", "rusty-library",
"calibre-db", "little-hesinde",
]
[workspace.dependencies]

View File

@ -10,7 +10,7 @@ WORKDIR /work
COPY . .
RUN cargo build --release --target=$(arch)-unknown-linux-musl
RUN cp "./target/$(arch)-unknown-linux-musl/release/rusty-library" /app
RUN cp "./target/$(arch)-unknown-linux-musl/release/little-hesinde" /app
FROM scratch

View File

@ -1,4 +1,4 @@
# Rusty Library
# Little Hesinde
I have been a long time user of [cops](https://github.com/seblucas/cops) and its
[fork](https://github.com/mikespub-org/seblucas-cops) in order to access my

View File

@ -1,5 +1,5 @@
{
description = "rusty-library project";
description = "little-hesinde project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";

View File

@ -1,5 +1,5 @@
[package]
name = "rusty-library"
name = "little-hesinde"
version = "0.1.0"
edition = "2021"
license = { workspace = true }

View File

@ -24,7 +24,7 @@ pub async fn handler(author: Author, books: Vec<Book>) -> Result<Response, poem:
};
let feed = Feed::create(
now,
&format!("rusty:author:{}", author.id),
&format!("little-hesinde:author:{}", author.id),
&author.name,
self_link,
vec![],

View File

@ -34,7 +34,7 @@ pub async fn handler(
};
let feed = Feed::create(
now,
"rusty:authors",
"little-hesinde:authors",
"All Authors",
self_link,
vec![],

View File

@ -33,7 +33,14 @@ pub async fn handler(
title: None,
count: None,
};
let feed = Feed::create(now, "rusty:books", "All Books", self_link, vec![], entries);
let feed = Feed::create(
now,
"little-hesinde:books",
"All Books",
self_link,
vec![],
entries,
);
let xml = feed.as_xml().map_err(HandlerError::OpdsError)?;
Ok(xml

View File

@ -25,7 +25,7 @@ pub async fn handler() -> Result<WithContentType<String>, poem::Error> {
};
let books_entry = Entry {
title: "Books".to_string(),
id: "rusty:books".to_string(),
id: "little-hesinde:books".to_string(),
updated: now,
content: Some(Content {
media_type: MediaType::Text,
@ -43,7 +43,7 @@ pub async fn handler() -> Result<WithContentType<String>, poem::Error> {
let authors_entry = Entry {
title: "Authors".to_string(),
id: "rusty:authors".to_string(),
id: "little-hesinde:authors".to_string(),
updated: now,
content: Some(Content {
media_type: MediaType::Text,
@ -61,7 +61,7 @@ pub async fn handler() -> Result<WithContentType<String>, poem::Error> {
let series_entry = Entry {
title: "Series".to_string(),
id: "rusty:series".to_string(),
id: "little-hesinde:series".to_string(),
updated: now,
content: Some(Content {
media_type: MediaType::Text,
@ -79,7 +79,7 @@ pub async fn handler() -> Result<WithContentType<String>, poem::Error> {
let recents_entry = Entry {
title: "Recent Additions".to_string(),
id: "rusty:recentbooks".to_string(),
id: "little-hesinde:recentbooks".to_string(),
updated: now,
content: Some(Content {
media_type: MediaType::Text,
@ -97,8 +97,8 @@ pub async fn handler() -> Result<WithContentType<String>, poem::Error> {
let feed = Feed::create(
now,
"rusty:catalog",
"Rusty-Library",
"little-hesinde:catalog",
"Little Hesinde",
self_link,
vec![],
vec![authors_entry, series_entry, books_entry, recents_entry],

View File

@ -23,7 +23,7 @@ pub async fn handler(recent_books: Vec<Book>) -> Result<Response, poem::Error> {
};
let feed = Feed::create(
now,
"rusty:recentbooks",
"little-hesinde:recentbooks",
"Recent Books",
self_link,
vec![],

View File

@ -31,7 +31,7 @@ pub async fn handler(
};
let feed = Feed::create(
now,
"rusty:series",
"little-hesinde:series",
"All Series",
self_link,
vec![],

View File

@ -24,7 +24,7 @@ pub async fn handler(series: Series, books: Vec<Book>) -> Result<Response, poem:
};
let feed = Feed::create(
now,
&format!("rusty:series:{}", series.id),
&format!("little-hesinde:series:{}", series.id),
&series.name,
self_link,
vec![],

View File

@ -1,5 +1,5 @@
use clap::Parser;
use rusty_library::{cli::Cli, config::Config};
use little_hesinde::{cli::Cli, config::Config};
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
@ -11,5 +11,5 @@ async fn main() -> Result<(), std::io::Error> {
let args = Cli::parse();
let config = Config::load(&args).expect("failed to load configuration");
rusty_library::run(config).await
little_hesinde::run(config).await
}

View File

@ -88,7 +88,7 @@ impl From<DbAuthor> for Entry {
Self {
title: value.name.clone(),
id: format!("rusty:authors:{}", value.id),
id: format!("little-hesinde:authors:{}", value.id),
updated: OffsetDateTime::now_utc(),
content: None,
author: None,
@ -112,7 +112,7 @@ impl From<Series> for Entry {
Self {
title: value.name.clone(),
id: format!("rusty:series:{}", value.id),
id: format!("little-hesinde:series:{}", value.id),
updated: OffsetDateTime::now_utc(),
content: None,
author: None,

View File

@ -50,7 +50,7 @@ impl Feed {
) -> Self {
let author = Author {
name: "Thallian".to_string(),
uri: "https://code.vanwa.ch/shu/rusty-library".to_string(),
uri: "https://code.vanwa.ch/shu/little-hesinde".to_string(),
email: None,
};
let mut links = vec![

View File

@ -6,7 +6,7 @@
<meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="/static/pico.min.css" />
<link rel="stylesheet" href="/static/style.css" />
<title>Rusty Library</title>
<title>Little Hesinde</title>
</head>
<body>
<header class="container fixed">
@ -28,7 +28,7 @@
<footer class="container">
<hr />
<small>
<div>From <a href="https://code.vanwa.ch/shu/rusty-library">https://code.vanwa.ch</a>
<div>From <a href="https://code.vanwa.ch/shu/little-hesinde">https://code.vanwa.ch</a>
under <a href="https://www.gnu.org/licenses/agpl-3.0.txt">AGPL-3</a></div>
<div><a href="/opds">opds feed</a></div>
</small>