fixes
This commit is contained in:
parent
28784d627d
commit
c36f125437
15 changed files with 13 additions and 15 deletions
0
.cargo/config.toml
Normal file → Executable file
0
.cargo/config.toml
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
Cargo.lock
generated
Normal file → Executable file
0
Cargo.lock
generated
Normal file → Executable file
0
Cargo.toml
Normal file → Executable file
0
Cargo.toml
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
LICENSE
Normal file → Executable file
0
README.md
Normal file → Executable file
0
README.md
Normal file → Executable file
0
Rocket.toml
Normal file → Executable file
0
Rocket.toml
Normal file → Executable file
0
default.nix
Normal file → Executable file
0
default.nix
Normal file → Executable file
8
fxpixiv.service.nix
Normal file → Executable file
8
fxpixiv.service.nix
Normal file → Executable file
|
@ -34,11 +34,15 @@ in
|
|||
serviceConfig.ExecStart = "${fxpixivApp}/bin/fxpixiv";
|
||||
|
||||
# Set the port environment variable
|
||||
serviceConfig.Environment = [
|
||||
serviceConfig.EnvironmentFile = pkgs.writeTextFile {
|
||||
name = "fxpixiv.env";
|
||||
text = ''
|
||||
"ROCKET_ENV=release"
|
||||
"ROCKET_PORT=${toString config.services.fxpixiv.port}"
|
||||
"PIXIV_REFRESH_TOKEN=${toString config.services.fxpixiv.refreshToken}"
|
||||
];
|
||||
'';
|
||||
meta.mode = "0600";
|
||||
};
|
||||
|
||||
# Restart on failure
|
||||
serviceConfig.WorkingDirectory = "/var/lib/fxpixiv";
|
||||
|
|
0
fxpixiv/Cargo.toml
Normal file → Executable file
0
fxpixiv/Cargo.toml
Normal file → Executable file
14
fxpixiv/src/main.rs
Normal file → Executable file
14
fxpixiv/src/main.rs
Normal file → Executable file
|
@ -112,9 +112,9 @@ async fn fetch_illust(
|
|||
";
|
||||
if illust.meta_pages.is_empty() {
|
||||
let _ = sqlx::query(pages_query)
|
||||
.bind(illust.image_urls.square_medium)
|
||||
.bind(illust.image_urls.medium)
|
||||
.bind(illust.image_urls.large)
|
||||
.bind(&illust.image_urls.square_medium)
|
||||
.bind(&illust.image_urls.medium)
|
||||
.bind(&illust.image_urls.large)
|
||||
.bind(
|
||||
&illust
|
||||
.meta_single_page
|
||||
|
@ -144,14 +144,8 @@ async fn fetch_illust(
|
|||
});
|
||||
}
|
||||
|
||||
let image = if illust.page_count == 1 {
|
||||
illust.meta_single_page.unwrap().original_image_url.unwrap()
|
||||
} else {
|
||||
illust.meta_pages[0].image_urls.original.clone()
|
||||
};
|
||||
|
||||
return Some(Metadata {
|
||||
image: image.as_str().replace("pximg.net", "fixiv.net"),
|
||||
image: illust.image_urls.large.replace("pximg.net", "fixiv.net"),
|
||||
title: illust.title,
|
||||
desc: illust.caption,
|
||||
});
|
||||
|
|
0
libpixiv/Cargo.toml
Normal file → Executable file
0
libpixiv/Cargo.toml
Normal file → Executable file
0
libpixiv/README.md
Normal file → Executable file
0
libpixiv/README.md
Normal file → Executable file
0
libpixiv/src/lib.rs
Normal file → Executable file
0
libpixiv/src/lib.rs
Normal file → Executable file
0
libpixiv/src/models.rs
Normal file → Executable file
0
libpixiv/src/models.rs
Normal file → Executable file
Loading…
Add table
Reference in a new issue