From 2a3d00f9abb835d728aaa90368c135c631d56267 Mon Sep 17 00:00:00 2001 From: Dan Audne Date: Mon, 8 May 2023 22:08:53 +0200 Subject: [PATCH] fix: rename slice hdrType to hdrTypes --- parser.go | 4 ++-- parser_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parser.go b/parser.go index 734d876..d767a3a 100644 --- a/parser.go +++ b/parser.go @@ -60,7 +60,7 @@ type Torrent struct { Episode int `json:"episode"` Languages []string `json:"languages"` Hdr bool `json:"hdr"` - HdrType []string `json:"hdrType"` + HdrTypes []string `json:"hdrTypes"` ColorDepth string `json:"colorDepth"` Date string `json:"date"` } @@ -137,7 +137,7 @@ func (p *parser) Parse() (Torrent, error) { } torrent.Episode = p.GetEpisode() torrent.Unrated = p.GetUnrated() - torrent.HdrType, torrent.Hdr = p.Hdr() + torrent.HdrTypes, torrent.Hdr = p.Hdr() torrent.ColorDepth = p.GetColorDepth() torrent.Languages = p.GetLanguages() diff --git a/parser_test.go b/parser_test.go index 978e11a..1aed984 100644 --- a/parser_test.go +++ b/parser_test.go @@ -369,7 +369,7 @@ func TestParser_Parse(t *testing.T) { Group: "NAHOM", Source: "bdremux", Languages: []string{"ita", "eng"}, - HdrType: []string{"DV"}, + HdrTypes: []string{"DV"}, Hdr: true, Season: -1, }, @@ -414,7 +414,7 @@ func TestParser_Parse(t *testing.T) { Source: "web-dl", Codec: "h265", Audio: "DDP5.1 Atmos", - HdrType: []string{"DV", "HDR10"}, + HdrTypes: []string{"DV", "HDR10"}, Hdr: true, Season: -1, Group: "CMRG", @@ -464,7 +464,7 @@ func TestContentType(t *testing.T) { func TestTorrentScanAndValue(t *testing.T) { var torrent Torrent - jsonStr := `{"title":"Pirates of the Caribbean Dead Mans Chest","alternativeTitle":"","contentType":0,"year":0,"resolution":"4k","extended":false,"unrated":false,"proper":false,"repack":false,"convert":false,"hardcoded":false,"retail":false,"remastered":false,"region":"","container":"mkv","source":"web-dl","codec":"hevc","audio":"dts-hd","group":"WATCHER","season":-1,"seasons":null,"episode":0,"languages":null,"hdr":true,"hdrType":null,"colorDepth":"","date":""}` + jsonStr := `{"title":"Pirates of the Caribbean Dead Mans Chest","alternativeTitle":"","contentType":0,"year":0,"resolution":"4k","extended":false,"unrated":false,"proper":false,"repack":false,"convert":false,"hardcoded":false,"retail":false,"remastered":false,"region":"","container":"mkv","source":"web-dl","codec":"hevc","audio":"dts-hd","group":"WATCHER","season":-1,"seasons":null,"episode":0,"languages":null,"hdr":true,"hdrTypes":null,"colorDepth":"","date":""}` err := torrent.Scan(jsonStr) if err != nil {