enclosure.go 864 B

1234567891011121314151617181920212223242526
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. // Enclosure represents an attachment.
  5. type Enclosure struct {
  6. ID int64 `json:"id"`
  7. UserID int64 `json:"user_id"`
  8. EntryID int64 `json:"entry_id"`
  9. URL string `json:"url"`
  10. MimeType string `json:"mime_type"`
  11. Size int64 `json:"size"`
  12. MediaProgression int64 `json:"media_progression"`
  13. }
  14. // Html5MimeType will modify the actual MimeType to allow direct playback from HTML5 player for some kind of MimeType
  15. func (e Enclosure) Html5MimeType() string {
  16. if e.MimeType == "video/m4v" {
  17. return "video/x-m4v"
  18. }
  19. return e.MimeType
  20. }
  21. // EnclosureList represents a list of attachments.
  22. type EnclosureList []*Enclosure