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

Refactor and expose Item model type #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
73 changes: 73 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ hyper-rustls = "0.22"
serde = "1.0.119"
serde_json = "1.0.61"
serde_derive = "1.0.119"
serde_with = "1.6"
tokio = { version = "1.0.2", features = ["rt-multi-thread", "macros"] }
csv = "1.1"
2 changes: 1 addition & 1 deletion src/bin/pickpocket-batch-favorite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() {
match app.get(&url as &str) {
Some(id) => {
let item = cache_reading_list.get(id).expect("cant locate id");
if item.favorite() == FavoriteStatus::NotFavorited {
if item.favorite == FavoriteStatus::NotFavorited {
ids.insert(id);
} else {
println!("Url {} already marked as favorite", url);
Expand Down
2 changes: 1 addition & 1 deletion src/bin/pickpocket-batch-read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async fn main() {
match app.get(&url as &str) {
Some(id) => {
let item = cache_reading_list.get(id).expect("cant locate id");
if item.status() == Status::Unread {
if item.status == Status::Unread {
ids.insert(id);
} else {
println!("Url {} already marked as read", url);
Expand Down
4 changes: 2 additions & 2 deletions src/bin/pickpocket-fixup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ async fn main() {
let mut read: BTreeSet<&str> = BTreeSet::new();

for (id, reading_item) in &reading_list {
if reading_item.favorite() == FavoriteStatus::Favorited {
if reading_item.favorite == FavoriteStatus::Favorited {
favorites.insert(id);
}

if reading_item.status() == Status::Read {
if reading_item.status == Status::Read {
read.insert(id);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/bin/pickpocket-from-csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ async fn main() {
}
Some(id) => {
let pocket_item = cache_reading_list.get(id).expect("cant locate id");
if pocket_item.status() == Status::Unread
&& (folder == "Archive" || folder == "Done")
if pocket_item.status == Status::Unread && (folder == "Archive" || folder == "Done")
{
read_ids.insert(id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/bin/pickpocket-inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
url = reading_item.url(),
clean = pickpocket::cleanup_url(reading_item.url()),
title = reading_item.title(),
status = reading_item.status()
status = reading_item.status
);
}
}
Loading