add playlists and profiles init/pull/push
This commit is contained in:
parent
3af050caa0
commit
fe5eb2db34
15 changed files with 305 additions and 114 deletions
|
|
@ -3,14 +3,15 @@ package model
|
|||
import "time"
|
||||
|
||||
type Playlist struct {
|
||||
ID uint `json:"-";gorm:"primary_key"`
|
||||
DeletedAt *time.Time `json:"-";sql:"index"`
|
||||
ID uint `json:"-" gorm:"primary_key"`
|
||||
CreatedAt time.Time `json:"-"`
|
||||
|
||||
PlaylistName string `json:"playlistName"`
|
||||
Protected bool `json:"protected"`
|
||||
Description string `json:"description"`
|
||||
Videos []PlaylistVideo `json:"videos"`
|
||||
Id string `json:"_id"`
|
||||
CreatedAt uint64 `json:"createdAt"`
|
||||
LastUpdatedAt uint64 `json:"lastUpdatedAt"`
|
||||
Hostname string `json:"-"`
|
||||
PlaylistName string `json:"playlistName"`
|
||||
Protected bool `json:"protected"`
|
||||
Description string `json:"description"`
|
||||
Videos []PlaylistVideo `json:"videos"`
|
||||
RemoteId string `json:"_id"`
|
||||
RemoteCreatedAt uint64 `json:"createdAt"`
|
||||
LastUpdatedAt uint64 `json:"lastUpdatedAt"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Profile struct {
|
||||
ID uint `json:"-";gorm:"primary_key"`
|
||||
DeletedAt *time.Time `json:"-";sql:"index"`
|
||||
ID uint `json:"-" gorm:"primary_key"`
|
||||
|
||||
Name string `json:"name"`
|
||||
BgColor string `json:"bgColor"`
|
||||
TextColor string `json:"textColor"`
|
||||
Subscriptions []Subscription `json:"subscriptions" gorm:"many2many:profile_subscription"`
|
||||
RemoteId string `json:"_id"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
)
|
||||
|
||||
type Pull struct {
|
||||
ID uint `json:"-";gorm:"primary_key"`
|
||||
ID uint `json:"-" gorm:"primary_key"`
|
||||
|
||||
Hostname string
|
||||
Database string
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Subscription struct {
|
||||
ID uint `json:"-";gorm:"primary_key"`
|
||||
DeletedAt *time.Time `json:"-";sql:"index"`
|
||||
ID uint `json:"-" gorm:"primary_key"`
|
||||
|
||||
Profiles []Profile `gorm:"many2many:profile_subscription"`
|
||||
Id string `json:"id"`
|
||||
RemoteId string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ package model
|
|||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type WatchedVideo struct {
|
||||
ID uint `json:"-";gorm:"primary_key"`
|
||||
DeletedAt *time.Time `json:"-";sql:"index"`
|
||||
ID uint `json:"-" gorm:"primary_key"`
|
||||
DeletedAt gorm.DeletedAt `json:"-" sql:"index"`
|
||||
|
||||
VideoId string `json:"videoId"`
|
||||
Title string `json:"title"`
|
||||
|
|
@ -20,14 +22,14 @@ type WatchedVideo struct {
|
|||
TimeWatched uint64 `json:"timeWatched"`
|
||||
IsLive bool `json:"isLive"`
|
||||
Type string `json:"type"`
|
||||
Id string `json:"_id"`
|
||||
RemoteId string `json:"_id"`
|
||||
LastViewedPlaylistType string `json:"lastViewedPlaylistType"`
|
||||
LastViewedPlaylistItemId *string `json:"lastViewedPlaylistItemId"`
|
||||
}
|
||||
|
||||
type PlaylistVideo struct {
|
||||
ID uint `gorm:"primary_key"`
|
||||
DeletedAt *time.Time `json:"-";sql:"index"`
|
||||
DeletedAt *time.Time `json:"-" sql:"index"`
|
||||
|
||||
PlaylistID uint
|
||||
VideoId string `json:"videoId"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue