Skip to content

Commit

Permalink
fix: rename slice hdrType to hdrTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfChaos committed May 8, 2023
1 parent 25fb25f commit 2a3d00f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}
Expand Down Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2a3d00f

Please sign in to comment.