mirror of
https://codeberg.org/YGGverse/ytd.git
synced 2026-04-08 21:05:30 +00:00
implement item_name_regex option
This commit is contained in:
parent
f52fe3a710
commit
93f9bc4fee
5 changed files with 30 additions and 0 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -48,6 +48,18 @@ async fn main() {
|
|||
debug!("items limit for channel `{c}` reached at {i}; break.");
|
||||
break;
|
||||
}
|
||||
if !channel
|
||||
.item_name_regex
|
||||
.as_ref()
|
||||
.is_some_and(|regex| regex.is_match(&item.name))
|
||||
{
|
||||
debug!(
|
||||
"item name `{}` for channel `{c}` does not match pattern `{}`; skip.",
|
||||
&item.name,
|
||||
&channel.item_name_regex.as_ref().unwrap()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
match database.get(&item.id) {
|
||||
Ok(id) => {
|
||||
if id.is_some() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue