player.go 820 B

123456789101112131415161718192021222324252627282930313233
  1. package feed
  2. import (
  3. "go-common/app/interface/main/app-feed/model"
  4. "go-common/app/service/main/archive/model/archive"
  5. "strconv"
  6. )
  7. func (i *Item) FromPlayerAv(a *archive.ArchiveWithPlayer) {
  8. if i.Title == "" {
  9. i.Title = a.Title
  10. }
  11. if i.Cover == "" {
  12. i.Cover = model.CoverURLHTTPS(a.Pic)
  13. } else {
  14. i.Cover = model.CoverURLHTTPS(i.Cover)
  15. }
  16. i.Param = strconv.FormatInt(a.Aid, 10)
  17. i.Goto = model.GotoAv
  18. i.URI = model.FillURI(i.Goto, i.Param, 0, 0, model.AvPlayHandler(a.Archive3, a.PlayerInfo))
  19. i.Cid = a.FirstCid
  20. i.Rid = a.TypeID
  21. i.TName = a.TypeName
  22. i.Desc = strconv.Itoa(int(a.Stat.Danmaku)) + "弹幕"
  23. i.fillArcStat(a.Archive3)
  24. i.Duration = a.Duration
  25. i.Mid = a.Author.Mid
  26. i.Name = a.Author.Name
  27. i.Face = a.Author.Face
  28. i.CTime = a.PubDate
  29. i.Cid = a.FirstCid
  30. i.Autoplay = a.Rights.Autoplay
  31. }