diff --git a/parsed_torrent.go b/parsed_torrent.go index 600a91e..980dd0e 100644 --- a/parsed_torrent.go +++ b/parsed_torrent.go @@ -5,7 +5,7 @@ import "git.milar.in/milarin/anilist" type ParsedTorrent struct { Torrent *Torrent Anime *anilist.Media - Name string + Title string Episode int Languages []string Resolution diff --git a/resolution.go b/resolution.go index 3ec0744..2fac7d6 100644 --- a/resolution.go +++ b/resolution.go @@ -8,11 +8,12 @@ import ( type Resolution int const ( - Resolution4K Resolution = 2160 - ResolutionQuadHD Resolution = 1440 - ResolutionFullHD Resolution = 1080 - ResolutionHD Resolution = 720 - ResolutionSD Resolution = 480 + Resolution4K Resolution = 2160 + ResolutionQuadHD Resolution = 1440 + ResolutionFullHD Resolution = 1080 + ResolutionHD Resolution = 720 + ResolutionSD Resolution = 480 + ResolutionUnknown Resolution = 0 ) @@ -25,7 +26,7 @@ func ParseResolution(str string) (Resolution, error) { case "SD": return ResolutionSD, nil default: - v, err := strconv.Atoi(str) + v, err := strconv.Atoi(strings.TrimSuffix(str, "p")) return Resolution(v), err } }