models

package
v0.0.0-...-05a34cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Episode

type Episode struct {
	EpisodeID   uuid.UUID `json:"episode_id" gorm:"primaryKey;type:uuid;default:gen_random_uuid()"`
	PodcastID   uuid.UUID `json:"podcast_id" gorm:"type:uuid;index:idx_podcast_item,unique"`
	Podcast     Podcast   `json:"-"`
	ItemID      string    `json:"guid" gorm:"index:idx_podcast_item,unique"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Date        time.Time `json:"date"`
	Duration    uint      `json:"duration"`
	URL         string    `json:"url"`
	templates.Timestamps
}

type EpisodePodcastPosition

type EpisodePodcastPosition struct {
	Episode  Episode   `json:"episode" gorm:"embedded"`
	Podcast  Podcast   `json:"podcast" gorm:"embedded"`
	Position *Position `json:"position" gorm:"embedded"`
}

type EpisodePosition

type EpisodePosition struct {
	Episode  Episode   `json:"episode" gorm:"embedded"`
	Position *Position `json:"position" gorm:"embedded"`
}

type NowPlaying

type NowPlaying struct {
	PositionUserID    uuid.UUID `json:"-" gorm:"primaryKey;type:uuid"`
	PositionEpisodeID uuid.UUID `json:"-"`
	Position          Position  `json:"-"`
}

type Podcast

type Podcast struct {
	PodcastID         uuid.UUID `json:"podcast_id" gorm:"primaryKey;type:uuid;default:gen_random_uuid()"`
	RSS               string    `json:"rss" gorm:"unique"`
	ImageID           uuid.UUID `json:"image_id" gorm:"type:uuid;default:gen_random_uuid()"`
	Title             string    `json:"title"`
	Description       string    `json:"description"`
	Color             string    `json:"color"`
	LastSyncAt        time.Time `json:"last_sync_at" gorm:"not null;default:'0001-01-01 00:00:00'"`
	LastSyncAttemptAt time.Time `json:"last_sync_attempt_at" gorm:"not null;default:'0001-01-01 00:00:00'"`
	templates.Timestamps
}

type Position

type Position struct {
	UserID       uuid.UUID `json:"-" gorm:"primaryKey;type:uuid"`
	User         User      `json:"-"`
	EpisodeID    uuid.UUID `json:"episode_id" gorm:"primaryKey;type:uuid"`
	Episode      Episode   `json:"-"`
	Completed    bool      `json:"completed"`
	CurrentTime  uint      `json:"current_time"`
	LastListened time.Time `json:"last_listened"`
	/* Duration is already reported in the RSS feed and stored on the Episode table, but it often
	 * isn't correct. The actual duration as measured by the client is stored here. */
	RealDuration uint `json:"real_duration"`
}

type Subscription

type Subscription struct {
	UserID    uuid.UUID `json:"-" gorm:"primaryKey;type:uuid"`
	User      User      `json:"-"`
	PodcastID uuid.UUID `json:"podcast_id" gorm:"primaryKey;type:uuid"`
	Podcast   Podcast   `json:"-"`
}

type User

type User struct {
	UserID   uuid.UUID `json:"user_id" gorm:"primaryKey;type:uuid;default:gen_random_uuid()"`
	Email    string    `json:"email" gorm:"unique"`
	Password string    `json:"-"`
	templates.Timestamps
}

func (*User) BeforeSave

func (user *User) BeforeSave(tx *gorm.DB) (err error)

func (*User) CheckPassword

func (user *User) CheckPassword(providedPassword string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL