Skip to content

Commit

Permalink
Merge PR #50 josueBarretogit/develop_v0.4.0
Browse files Browse the repository at this point in the history
Release v0.4.0
  • Loading branch information
josueBarretogit authored Nov 2, 2024
2 parents 7e9e545 + c3c0ae2 commit 1a99f72
Show file tree
Hide file tree
Showing 28 changed files with 4,447 additions and 502 deletions.
42 changes: 27 additions & 15 deletions Cargo.lock

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

17 changes: 7 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "manga-tui"
version = "0.3.1"
version = "0.4.0"
edition = "2021"
authors = ["Josue <[email protected]>"]
readme = "README.md"
Expand All @@ -11,19 +11,16 @@ keywords = ["cli", "command-line"]
categories = ["command-line-interface"]
license = "MIT"
exclude = [
"public/*"
]
include = [
"**/*.rs",
"Cargo.toml",
"public/*",
"data_test/*"
]

[dependencies]
ratatui = { version = "0.28.0", features = ["all-widgets", "palette", "unstable-widget-ref"] }
ratatui = { version = "0.29.0", features = ["all-widgets", "palette", "unstable-widget-ref"] }
ratatui-image = { version = "1.0.5", features = ["rustix"]}
throbber-widgets-tui = "0.7.0"
tui-input = "0.10.0"
tui-widget-list = "0.12.0"
throbber-widgets-tui = "0.8.0"
tui-input = "0.11.0"
tui-widget-list = "0.13.0"
crossterm = { version = "0.28.1", features = ["event-stream"] }
directories = "5.0.1"
image = "0.25.1"
Expand Down
16 changes: 13 additions & 3 deletions manga-tui-config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# The format of the manga downloaded
# values : cbz , raw, epub
# default : cbz
download_type = "cbz"
download_type = "cbz"

# Download image quality, low quality means images are compressed and is recommended for slow internet connections
# values : low, high
# default : low
image_quality = "low"
image_quality = "low"

# Pages around the currently selected page to try to prefetch
# values : 0-255
# default : 5
amount_pages = 5

# Whether or not bookmarking is done automatically, if false you decide which chapter to bookmark
# values : true, false
# default : true
auto_bookmark = true
9 changes: 5 additions & 4 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod download;
pub mod error_log;
pub mod fetch;
pub mod filter;
pub mod migration;
pub mod tui;

#[derive(Display, EnumIter)]
Expand Down Expand Up @@ -79,7 +80,7 @@ pub static APP_DATA_DIR: Lazy<Option<PathBuf>> = Lazy::new(|| {
#[cfg(test)]
pub static APP_DATA_DIR: Lazy<Option<PathBuf>> = Lazy::new(|| Some(PathBuf::from("./test_results/data-directory")));

pub fn build_data_dir() -> Result<PathBuf, std::io::Error> {
pub fn build_data_dir() -> Result<PathBuf, Box<dyn std::error::Error>> {
let data_dir = APP_DATA_DIR.as_ref();
match data_dir {
Some(dir) => {
Expand All @@ -95,13 +96,13 @@ pub fn build_data_dir() -> Result<PathBuf, std::io::Error> {

let config_contents = MangaTuiConfig::read_raw_config(dir)?;

let config_contents: MangaTuiConfig = toml::from_str(&config_contents).unwrap_or_default();
let config = MangaTuiConfig::update_existing_config(&config_contents, dir)?;

CONFIG.get_or_init(|| config_contents);
CONFIG.get_or_init(|| config);

Ok(dir.to_path_buf())
},
None => Err(std::io::Error::other("data dir could not be found")),
None => Err("data dir could not be found".into()),
}
}

Expand Down
Loading

0 comments on commit 1a99f72

Please sign in to comment.