Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def input = args.getFiles{ it.isVideo() || it.isSubtitle() }
- // ignore clutter files
- input = input.findAll{ !(it.path =~ /\b(?i:sample|trailer|extras|deleted.scenes|music.video|scrapbook)\b/) }
- input.each{ f ->
- def match = [movie:null, series:null, docu:null, anime:null]
- // try as movie
- def movie = detectMovie(f, false)
- if (movie) {
- match.movie = movie
- }
- // try as tv series
- def seriesName = detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })
- if (seriesName) {
- def resultSet = TheTVDB.search(seriesName, Locale.ENGLISH)
- if (resultSet.size() > 0) {
- match.series = resultSet
- }
- }
- // try as anime
- def animeName = detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })
- if (animeName) {
- def resultSet = AniDB.search(animeName, Locale.ENGLISH)
- if (resultSet.size() > 0) {
- match.anime = resultSet
- }
- }
- // try as docu
- def docuName = detectSeriesName(f) ?: detectSeriesName(f.dir.listFiles{ it.isVideo() })
- if (docuName) {
- docuName = null // TODO docu search
- }
- println "$f => $match"
- // TODO DECIDE movie VS series VS anime VS docu
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement