hunch 2.0.2

A media filename parser for movies, TV, and anime — built in Rust, inspired by guessit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Country detection — now fully handled by `src/rules/country.toml`.

#[cfg(test)]
mod tests {
    use crate::hunch;

    fn country(input: &str) -> Option<String> {
        let map = hunch(input).to_flat_map();
        map.get("country")
            .and_then(|v| v.as_str())
            .map(String::from)
    }

    #[test]
    fn test_us() {
        assert_eq!(country("Movie.US.mkv"), Some("US".into()));
    }
}