mirror of
https://codeberg.org/YGGverse/ytd.git
synced 2026-04-08 12:55:32 +00:00
remove extra method
This commit is contained in:
parent
d1bb71a63a
commit
b676060798
2 changed files with 1 additions and 5 deletions
|
|
@ -20,10 +20,6 @@ impl Database {
|
||||||
Ok(table.get(item_id)?.map(|v| v.value()))
|
Ok(table.get(item_id)?.map(|v| v.value()))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_processed(&self, item_id: &str) -> Result<bool, Error> {
|
|
||||||
Ok(self.get(item_id)?.is_some())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn process(&mut self, item_id: &str) -> Result<(), Error> {
|
pub fn process(&mut self, item_id: &str) -> Result<(), Error> {
|
||||||
let write = self.0.begin_write()?;
|
let write = self.0.begin_write()?;
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ async fn main() {
|
||||||
let items = result.content.items;
|
let items = result.content.items;
|
||||||
debug!("received {:?} items to handle...", items.len());
|
debug!("received {:?} items to handle...", items.len());
|
||||||
for item in items {
|
for item in items {
|
||||||
if database.is_processed(&item.id).is_ok_and(|r| r) {
|
if database.get(&item.id).is_ok_and(|r| r.is_some()) {
|
||||||
debug!(
|
debug!(
|
||||||
"item `{}` for channel `{c}` already processed; skip handle.",
|
"item `{}` for channel `{c}` already processed; skip handle.",
|
||||||
item.id
|
item.id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue