mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-11-06 06:13:57 +03:00
rename var
This commit is contained in:
parent
8adce860b7
commit
01cdf12b54
1 changed files with 7 additions and 8 deletions
|
@ -22,7 +22,7 @@ func GetWallpaper() string {
|
||||||
panic(marshalErr)
|
panic(marshalErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Wallpaper struct {
|
type WallpaperStruct struct {
|
||||||
Hdurl string `json:"hdurl"`
|
Hdurl string `json:"hdurl"`
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
Media_type string `json:"media_type"`
|
Media_type string `json:"media_type"`
|
||||||
|
@ -39,20 +39,19 @@ func GetWallpaper() string {
|
||||||
panic(StringErr)
|
panic(StringErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
var wallpaper Wallpaper
|
var Wallpaper WallpaperStruct
|
||||||
jsonErr := json.Unmarshal([]byte(body), &wallpaper)
|
jsonErr := json.Unmarshal([]byte(body), &Wallpaper)
|
||||||
|
|
||||||
if jsonErr != nil {
|
if jsonErr != nil {
|
||||||
panic(jsonErr)
|
panic(jsonErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if wallpaper.Media_type == "video" {
|
if Wallpaper.Media_type == "video" {
|
||||||
wallpaper.Url = wallpaper.Url[30 : len(wallpaper.Url)-6]
|
Wallpaper.Url = Wallpaper.Url[30 : len(Wallpaper.Url)-6]
|
||||||
|
return "https://img.youtube.com/vi/" + Wallpaper.Url + "/0.jpg"
|
||||||
return "https://img.youtube.com/vi/" + wallpaper.Url + "/0.jpg"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return wallpaper.Hdurl
|
return Wallpaper.Hdurl
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetWallpaper() {
|
func SetWallpaper() {
|
||||||
|
|
Loading…
Reference in a new issue