mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 12:12:00 -06:00
Use episode sequence number as filter number for url episode filtering
This commit is contained in:
parent
d0fe7f54f6
commit
5a3a304443
4 changed files with 9 additions and 9 deletions
|
|
@ -10,8 +10,8 @@ use regex::Regex;
|
|||
/// If `to_*` is [`None`] they're set to [`u32::MAX`].
|
||||
#[derive(Debug, Default)]
|
||||
pub struct InnerUrlFilter {
|
||||
from_episode: Option<u32>,
|
||||
to_episode: Option<u32>,
|
||||
from_episode: Option<f32>,
|
||||
to_episode: Option<f32>,
|
||||
from_season: Option<u32>,
|
||||
to_season: Option<u32>,
|
||||
}
|
||||
|
|
@ -39,10 +39,10 @@ impl UrlFilter {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn is_episode_valid(&self, episode: u32, season: u32) -> bool {
|
||||
pub fn is_episode_valid(&self, episode: f32, season: u32) -> bool {
|
||||
self.inner.iter().any(|f| {
|
||||
let from_episode = f.from_episode.unwrap_or(u32::MIN);
|
||||
let to_episode = f.to_episode.unwrap_or(u32::MAX);
|
||||
let from_episode = f.from_episode.unwrap_or(f32::MIN);
|
||||
let to_episode = f.to_episode.unwrap_or(f32::MAX);
|
||||
let from_season = f.from_season.unwrap_or(u32::MIN);
|
||||
let to_season = f.to_season.unwrap_or(u32::MAX);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue