Skip to content

Commit c5c8785

Browse files
committed
Add Readeck support
1 parent 412b896 commit c5c8785

File tree

6 files changed

+385
-1
lines changed

6 files changed

+385
-1
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ rand_core = "0.6.4"
3939
rand_xoshiro = "0.6.0"
4040
percent-encoding = "2.3.1"
4141
chrono = { version = "0.4.38", features = ["serde", "clock"], default-features = false }
42-
ureq = { version = "3.0.12", features = ["cookies"] }
42+
ureq = { version = "3.0.12", features = ["cookies", "json"] }
4343
http = "1.3.1"
4444
url = "2.5.4"

crates/core/src/articles/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod dummy;
2+
mod readeck;
23
mod wallabag;
34

45
use chrono::FixedOffset;
@@ -17,6 +18,7 @@ use std::{
1718

1819
use crate::settings::ArticleAuth;
1920
use crate::{
21+
articles::readeck::Readeck,
2022
articles::wallabag::Wallabag,
2123
metadata::{FileInfo, Info},
2224
settings::{self, ArticleList},
@@ -130,6 +132,7 @@ fn read_index() -> Result<ArticleIndex, Error> {
130132
pub fn load(auth: settings::ArticleAuth) -> Box<dyn Service> {
131133
let index = read_index().unwrap_or_default();
132134
match auth.api.as_str() {
135+
"readeck" => Box::new(Readeck::load(auth, index)),
133136
"wallabag" => Box::new(Wallabag::load(auth, index)),
134137
_ => Box::new(dummy::Dummy::new()),
135138
}
@@ -142,6 +145,7 @@ pub fn authenticate(
142145
password: String,
143146
) -> Result<ArticleAuth, String> {
144147
match api.as_str() {
148+
"readeck" => readeck::authenticate(server, "Plato".to_string(), username, password),
145149
"wallabag" => wallabag::authenticate(server, "Plato".to_string(), username, password),
146150
_ => Err(format!("unknown API: {api}")),
147151
}

0 commit comments

Comments
 (0)