Giter VIP home page Giter VIP logo

Comments (1)

Bas-Man avatar Bas-Man commented on August 22, 2024

@IGI-111

This does not appear to be resolved using my test cases.

#[cfg(test)]
mod country {

    use crate::metadata::Metadata;

    #[test]
    fn the_last_of_us() {
        let m = Metadata::from("the.last.of.us.s01E01.avi").unwrap();
        assert_eq!(m.title(), "the last of us");
        assert_eq!(m.season(), Some(1));
        assert_eq!(m.country(), None);
    }
    #[test]
    fn the_last_of_us_year() {

        let m = Metadata::from("the.last.of.us.2023.s01E01.avi").unwrap();
        assert_eq!(m.title(), "the last of us");
        assert_eq!(m.season(), Some(1));
        assert_eq!(m.country(), None);

    }
    #[test]
    fn criminal_uk() {

        let m = Metadata::from("criminal.uk.s01E01.avi").unwrap();
        assert_eq!(m.title(), "criminal uk");
        assert_eq!(m.country(), None);

    }

    #[test]
    fn criminal_uk_with_year() {

        let m = Metadata::from("criminal.uk.2019.s01E01.avi").unwrap();
        assert_eq!(m.title(), "criminal uk");
        assert_eq!(m.year(), Some(2019));
        assert_eq!(m.country(), None);

    }
    #[test]
    fn life_on_mars_us() {
        let m = Metadata::from("Life.on.Mars.US.S01E01.avi").unwrap();
        assert_eq!(m.title(), "Life on Mars");
    }
}

I can submit a pull request to provide these.

I have also worked on my own solution. But it makes use of RegexSet to check if the name contains these problematic strings. I recall you were not keen on a similar solution before see #27

from torrent-name-parser.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.