Skip to content

Commit

Permalink
feat: parse autoplay enabled settings
Browse files Browse the repository at this point in the history
  • Loading branch information
devgianlu committed Feb 19, 2024
1 parent 0bff8f8 commit fb3f1ab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/daemon/product_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ type ProductInfo struct {
Type string `xml:"type"`
HeadFilesUrl string `xml:"head-files-url"`
ImageUrl string `xml:"image-url"`
Autoplay string `xml:"autoplay"`
} `xml:"product"`
}

func (pi ProductInfo) ImageUrl(fileId string) string {
return strings.Replace(pi.Products[0].ImageUrl, "{file_id}", strings.ToLower(fileId), 1)
}

func (pi ProductInfo) AutoplayEnabled() bool {
return pi.Products[0].Autoplay == "1"
}

0 comments on commit fb3f1ab

Please sign in to comment.