mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-08 00:54:17 +00:00
23 lines
558 B
Go
23 lines
558 B
Go
package service
|
|
|
|
import "strings"
|
|
|
|
const (
|
|
VideoBillingResolution480P = "480p"
|
|
VideoBillingResolution720P = "720p"
|
|
VideoBillingResolution1080P = "1080p"
|
|
)
|
|
|
|
func NormalizeVideoBillingResolutionOrDefault(resolution string) string {
|
|
switch strings.ToLower(strings.TrimSpace(resolution)) {
|
|
case "480", "480p", "sd":
|
|
return VideoBillingResolution480P
|
|
case "720", "720p", "hd":
|
|
return VideoBillingResolution720P
|
|
case "1080", "1080p", "full_hd", "full-hd", "fhd":
|
|
return VideoBillingResolution1080P
|
|
default:
|
|
return VideoBillingResolution480P
|
|
}
|
|
}
|