mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Add basic search command
This commit is contained in:
parent
0beaa99bfd
commit
0aa648b1a5
10 changed files with 1352 additions and 702 deletions
|
|
@ -8,7 +8,7 @@ use regex::Regex;
|
|||
/// If a struct instance equals the [`Default::default()`] it's considered that no find is applied.
|
||||
/// If `from_*` is [`None`] they're set to [`u32::MIN`].
|
||||
/// If `to_*` is [`None`] they're set to [`u32::MAX`].
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct InnerUrlFilter {
|
||||
from_episode: Option<u32>,
|
||||
to_episode: Option<u32>,
|
||||
|
|
@ -16,11 +16,19 @@ pub struct InnerUrlFilter {
|
|||
to_season: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
#[derive(Debug)]
|
||||
pub struct UrlFilter {
|
||||
inner: Vec<InnerUrlFilter>,
|
||||
}
|
||||
|
||||
impl Default for UrlFilter {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
inner: vec![InnerUrlFilter::default()],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl UrlFilter {
|
||||
pub fn is_season_valid(&self, season: u32) -> bool {
|
||||
self.inner.iter().any(|f| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue