-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(tori)!: add support for beta.tori.fi #40
base: main
Are you sure you want to change the base?
Conversation
After the new Tori.fi update, there is no way to uniquely identify the seller of an ad. I've decided to get rid of the seller blacklist feature all together, despite it still being possible for Huuto.net ads. This is an unfortunate design choice on Tori.fi's part and in my personal opinion the complete opposite of what should've been done.
@@ -25,14 +28,16 @@ extern crate tracing; | |||
#[macro_use] | |||
extern crate diesel; | |||
|
|||
use std::sync::{Arc, LazyLock, RwLock}; | |||
use std::sync::{Arc, LazyLock}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use parking_lot, it will make everything nicer since they can never panic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are also faster and smaller in memory (but require that the platform you are deploying to can park threads)
#[derive(Deserialize, Debug, Clone)] | ||
pub struct ToriItem { | ||
/// Type of the item for Torimies always "bap" | ||
//pub r#type: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prolly get rid of this, if its unused.
If it is, it is much better to use #[serde(rename = "type")]
and name the field something less keywordy
None | ||
} | ||
let ret = api_parse_after(&res, self.last_updated) | ||
.unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unwrap? :(
} | ||
#[cfg(feature = "tori")] | ||
{ | ||
if site_id == crate::tori::ID { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.get(&k) | ||
.expect("bug: impossible") | ||
.lock() | ||
.unwrap() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, you could avoid this with parking lot
This will bump the version to 0.3.0.
We are dropping support for:
Some things I'd still like to address in this PR: