plex_media.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package plexapi
  2. import "encoding/xml"
  3. // Video struct
  4. type Video struct {
  5. server *Server
  6. Keys []KeyInfo `xml:"-"`
  7. Paths []string `xml:"-"`
  8. FID string `xml:"-"`
  9. XMLName xml.Name `xml:"Video"`
  10. GUID string `xml:"guid,attr"`
  11. RatingKey string `xml:"ratingKey,attr"`
  12. Key string `xml:"key,attr"`
  13. Studio string `xml:"studio,attr"`
  14. Type string `xml:"type,attr"`
  15. Title string `xml:"title,attr"`
  16. TitleSort string `xml:"titleSort,attr"`
  17. ContentRating string `xml:"contentRating,attr"`
  18. Summary string `xml:"summary,attr"`
  19. Rating string `xml:"rating,attr"`
  20. ViewCount string `xml:"viewCount,attr"`
  21. ViewOffset string `xml:"viewOffset,attr"`
  22. LastViewedAt string `xml:"lastViewedAt,attr"`
  23. Year string `xml:"year,attr"`
  24. Tagline string `xml:"tagline,attr"`
  25. Thumb string `xml:"thumb,attr"`
  26. Art string `xml:"art,attr"`
  27. Duration string `xml:"duration,attr"`
  28. OriginallyAvailableAt string `xml:"originallyAvailableAt,attr"`
  29. AddedAt string `xml:"addedAt,attr"`
  30. UpdatedAt string `xml:"updatedAt,attr"`
  31. ChapterSource string `xml:"chapterSource,attr"`
  32. Media Media `xml:"Media"`
  33. Genre Genre `xml:"Genre"`
  34. Writer Writer `xml:"Writer"`
  35. Country Country `xml:"Country"`
  36. Role Role `xml:"Role"`
  37. Director Director `xml:"Director"`
  38. }
  39. // Media struct
  40. type Media struct {
  41. XMLName xml.Name `xml:"Media"`
  42. VideoResolution string `xml:"videoResolution,attr"`
  43. ID string `xml:"id,attr"`
  44. Duration string `xml:"duration,attr"`
  45. Bitrate string `xml:"bitrate,attr"`
  46. Width string `xml:"width,attr"`
  47. Height string `xml:"height,attr"`
  48. AspectRatio string `xml:"aspectRatio,attr"`
  49. AudioChannels string `xml:"audioChannels,attr"`
  50. AudioCodec string `xml:"audioCodec,attr"`
  51. VideoCodec string `xml:"videoCodec,attr"`
  52. Container string `xml:"container,attr"`
  53. VideoFrameRate string `xml:"videoFrameRate,attr"`
  54. VideoProfile string `xml:"videoProfile,attr"`
  55. Parts []Part `xml:"Part"`
  56. }
  57. // Part struct
  58. type Part struct {
  59. XMLName xml.Name `xml:"Part"`
  60. ID string `xml:"id,attr"`
  61. Key string `xml:"key,attr"`
  62. Duration string `xml:"duration,attr"`
  63. File string `xml:"file,attr"`
  64. Sizecontainer string `xml:"sizecontainer,attr"`
  65. DeepAnalysisVersion string `xml:"deepAnalysisVersion,attr"`
  66. RequiredBandwidths string `xml:"requiredBandwidths,attr"`
  67. VideoProfile string `xml:"videoProfile,attr"`
  68. }
  69. // Genre struct
  70. type Genre struct {
  71. XMLName xml.Name `xml:"Genre"`
  72. Tag string `xml:"tag,attr"`
  73. }
  74. // Writer struct
  75. type Writer struct {
  76. XMLName xml.Name `xml:"Writer"`
  77. Tag string `xml:"tag,attr"`
  78. }
  79. // Country struct
  80. type Country struct {
  81. XMLName xml.Name `xml:"Country"`
  82. Tag string `xml:"tag,attr"`
  83. }
  84. // Role struct
  85. type Role struct {
  86. XMLName xml.Name `xml:"Role"`
  87. Tag string `xml:"tag,attr"`
  88. }
  89. // Director struct
  90. type Director struct {
  91. XMLName xml.Name `xml:"Director"`
  92. Tag string `xml:"tag,attr"`
  93. }
  94. // Data struct
  95. type Data struct {
  96. Videos map[string]Video
  97. UpdatedAt map[string]int64
  98. }
  99. // GetServer func
  100. func (v *Video) GetServer() *Server {
  101. return v.server
  102. }