Skip to content

Commit

Permalink
feat: Update watchers (#11)
Browse files Browse the repository at this point in the history
* Add Watch trait for backend

* WIP: Add FeedWatcher

* Implement FeedWatcher

* Update FeedWatcher

* Update PostThreadWatcher

* Use Updater
  • Loading branch information
sugyan committed Jul 11, 2024
1 parent a7597fd commit 7589fdf
Show file tree
Hide file tree
Showing 20 changed files with 904 additions and 615 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["tui", "atproto", "bluesky", "atrium"]
exclude = ["/config"]

[dependencies]
bsky-sdk = "0.1.4"
bsky-sdk = "0.1.5"
chrono = { version = "0.4.38", default-features = false }
clap = { version = "4.5.8", features = ["derive"] }
color-eyre = "0.6.3"
Expand Down
6 changes: 5 additions & 1 deletion config/tuisky.config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@
"type": "integer",
"minimum": 1
},
"feed_view_posts": {
"feed": {
"type": "integer",
"minimum": 1
},
"post_thread": {
"type": "integer",
"minimum": 1
}
Expand Down
5 changes: 2 additions & 3 deletions src/backend.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub mod config;
mod post_thread;
pub mod types;
mod watch;
mod watches;

pub use post_thread::PostThreadWatcher;
pub use watch::Watcher;
pub use watch::{Watch, Watcher};
6 changes: 3 additions & 3 deletions src/backend/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ pub struct Config {
#[serde(default)]
pub struct Intervals {
pub preferences: u64,
pub feed_view_posts: u64,
pub feed: u64,
pub post_thread: u64,
}

impl Default for Intervals {
fn default() -> Self {
Self {
preferences: 60,
feed_view_posts: 30,
preferences: 600,
feed: 30,
post_thread: 60,
}
}
Expand Down
125 changes: 0 additions & 125 deletions src/backend/post_thread.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/backend/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ use bsky_sdk::api::app::bsky::feed::defs::GeneratorView;
#[derive(Debug, Clone)]
pub struct SavedFeed {
pub pinned: bool,
pub value: SavedFeedValue,
pub value: FeedDescriptor,
}

#[derive(Debug, Clone)]
pub enum SavedFeedValue {
pub enum FeedDescriptor {
Feed(Box<GeneratorView>),
List, // TODO
Timeline(String),
Expand Down
Loading

0 comments on commit 7589fdf

Please sign in to comment.