Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add anilist integration #63

Merged
merged 14 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUST_TOOLCHAIN_VERSION : "nightly"

jobs:
check_code_format_and_lint:
Expand All @@ -21,14 +22,19 @@ jobs:
- name: setup toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly-2024-06-25
rust-version: ${{ env.RUST_TOOLCHAIN_VERSION }}

- name: install_dependencies
run: sudo apt install libdbus-1-dev pkg-config

- name: check-fmt
run: cargo fmt --check

- name: clippy
run: cargo clippy -- -D warnings



build_and_test:
strategy:
fail-fast: false
Expand All @@ -44,7 +50,11 @@ jobs:
- name: setup toolchain
uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly-2024-06-25
rust-version: ${{ env.RUST_TOOLCHAIN_VERSION }}

- name: Install dependencies (Linux only)
if: runner.os == 'Linux'
run: sudo apt install libdbus-1-dev pkg-config

- name: check
run: cargo check --locked
Expand All @@ -53,7 +63,7 @@ jobs:
run: cargo build --release --verbose

- name: install cargo nextest
run: cargo install cargo-nextest
run: cargo install cargo-nextest@0.9.82

- name: test
run: cargo nextest run --no-fail-fast
Expand All @@ -78,5 +88,9 @@ jobs:
with:
use-flakehub: false

- name: install_dependencies
run: sudo apt install libdbus-1-dev pkg-config


- name: Build default package
run: nix build
152 changes: 151 additions & 1 deletion Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,17 @@ clap = { version = "4.5.18", features = ["derive", "cargo"] }
zip = "2.1.6"
toml = "0.8.19"
epub-builder = "0.7.4"
http = "1.0"
keyring = { version = "3", features = ["apple-native", "windows-native", "sync-secret-service"] }
log = { version = "0.4", features = ["std", "serde"] }
pretty_env_logger = "0.4"

[dev-dependencies]
httpmock = "0.7.0-rc.1"
pretty_assertions = "1.4.0"
rusty-hook = "0.11.2"
uuid = { version = "1.10.0", features = ["v4", "fast-rng"] }
fake = "2.10.0"
http = "1.0"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_System_Console", "Win32_UI_HiDpi"]}

5 changes: 5 additions & 0 deletions manga-tui-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ amount_pages = 5
# values : true, false
# default : true
auto_bookmark = true

# Whether or not downloading a manga counts as reading it on services like anilist
# values : true, false
# default : false
track_reading_when_download = false
3 changes: 3 additions & 0 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pub mod error_log;
pub mod fetch;
pub mod filter;
pub mod migration;
pub mod release_notifier;
pub mod secrets;
pub mod tracker;
pub mod tui;

#[derive(Display, EnumIter)]
Expand Down
12 changes: 12 additions & 0 deletions src/backend/error_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ pub enum ErrorType<'a> {
String(&'a str),
}

impl<'a> From<Box<dyn Error>> for ErrorType<'a> {
fn from(value: Box<dyn Error>) -> Self {
Self::Error(value)
}
}

impl<'a> From<String> for ErrorType<'a> {
fn from(value: String) -> Self {
Self::Error(value.into())
}
}

fn get_error_logs_path() -> PathBuf {
let path = AppDirectories::ErrorLogs.get_base_directory();

Expand Down
Loading