stremio/node/media-node/internal/scanner/parser_test.go
Jos Vooges | STH a5c6fd5fe4 Initial commit: Distributed Stremio Media Cluster V1
Master API, Admin UI, Go media-node, Docker/Dokploy deploy configs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 00:17:04 +02:00

36 lines
839 B
Go

package scanner
import "testing"
func TestParseMovie(t *testing.T) {
p := parseMovie("The.Matrix.1999.2160p.UHD.BluRay.REMUX.HEVC.TrueHD.Atmos")
if p == nil {
t.Fatal("expected parse result")
}
if p["title"] != "The Matrix" {
t.Fatalf("title=%v", p["title"])
}
if p["year"] != 1999 {
t.Fatalf("year=%v", p["year"])
}
}
func TestParseSeries(t *testing.T) {
p := parseSeries("Breaking.Bad.S03E04.1080p.BluRay")
if p == nil {
t.Fatal("expected parse result")
}
if p["title"] != "Breaking Bad" {
t.Fatalf("title=%v", p["title"])
}
if p["season"] != 3 || p["episode"] != 4 {
t.Fatalf("season/episode=%v/%v", p["season"], p["episode"])
}
}
func TestParseSeriesAlt(t *testing.T) {
p := parseSeries("Show.Name.1x02.720p")
if p == nil || p["season"] != 1 || p["episode"] != 2 {
t.Fatalf("unexpected: %#v", p)
}
}