mirror of
https://codeberg.org/YGGverse/ytd.git
synced 2026-04-08 12:55:32 +00:00
rename limit option to items_limit; fix item_name_regex config example
This commit is contained in:
parent
93f9bc4fee
commit
f2b79b2a06
3 changed files with 4 additions and 4 deletions
|
|
@ -16,8 +16,8 @@ sleep = 1
|
||||||
is_live = false
|
is_live = false
|
||||||
is_short = false
|
is_short = false
|
||||||
is_upcoming = false
|
is_upcoming = false
|
||||||
# limit = 1
|
# items_limit = 1
|
||||||
# name_regex = ".*"
|
# item_name_regex = ".*"
|
||||||
|
|
||||||
# Channel item commands to apply (in order)
|
# Channel item commands to apply (in order)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ pub struct Channel {
|
||||||
pub is_live: bool,
|
pub is_live: bool,
|
||||||
pub is_short: bool,
|
pub is_short: bool,
|
||||||
pub is_upcoming: bool,
|
pub is_upcoming: bool,
|
||||||
pub limit: Option<usize>,
|
pub items_limit: Option<usize>,
|
||||||
#[serde(with = "serde_regex")]
|
#[serde(with = "serde_regex")]
|
||||||
pub item_name_regex: Option<Regex>,
|
pub item_name_regex: Option<Regex>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 (i, item) in items.into_iter().enumerate() {
|
for (i, item) in items.into_iter().enumerate() {
|
||||||
if channel.limit.is_some_and(|l| i > l) {
|
if channel.items_limit.is_some_and(|l| i > l) {
|
||||||
debug!("items limit for channel `{c}` reached at {i}; break.");
|
debug!("items limit for channel `{c}` reached at {i}; break.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue