middelink/go-parse-torrent-name

panic: runtime error: slice bounds out of range

SchnorcherSepp opened this issue · 2 comments

The string NCIS.S01.-.S05.DUAL.COMPLETE.BLURAY.UNTOUCHED-HD_Leaks produce a panic

panic: runtime error: slice bounds out of range

goroutine 1 [running]:
Scanner/vendor/github.com/middelink/go-parse-torrent-name.Parse(0xc0431fb735, 0x36, 0x10, 0x7dc, 0x215fd)
	go/src/Scanner/vendor/github.com/middelink/go-parse-torrent-name/parser.go:82 +0x51c
Scanner/themoviedb.SearchMovieID(0xc0431fb735, 0x36, 0xc0431fbcdd, 0x9, 0x215fd)
	go/src/Scanner/themoviedb/connector.go:23 +0x75
main.main()
	go/src/Scanner/main.go:46 +0x259

It's probably because the directory itself does not really follow "The Scene" naming convention as per https://scenerules.org/t.html?id=tvx2642k16.nfo

Sorry for the delay, it seems I have fixed the issue in the mean time as it crashed for me too on a different name.

Commit f066ce0 should have fixed it.