added resolution
This commit is contained in:
parent
96f16f9e05
commit
f8b66e8c9e
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user