mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-12-18 13:36:09 +05:00
fixes
This commit is contained in:
@@ -272,12 +272,22 @@ func mapKPTypeToUnifiedShort(t string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func yearToDate(y string) string {
|
||||
y = strings.TrimSpace(y)
|
||||
if y == "" {
|
||||
func yearToDate(y interface{}) string {
|
||||
switch v := y.(type) {
|
||||
case int:
|
||||
if v == 0 {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%d-01-01", v)
|
||||
case string:
|
||||
v = strings.TrimSpace(v)
|
||||
if v == "" {
|
||||
return ""
|
||||
}
|
||||
return v + "-01-01"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
return y + "-01-01"
|
||||
}
|
||||
|
||||
func firstCountry(countries []models.ProductionCountry) string {
|
||||
|
||||
Reference in New Issue
Block a user