Skip to content
Snippets Groups Projects
Commit f4e59cd2 authored by Christian Pointner's avatar Christian Pointner
Browse files

fix struct tags

parent 3510ec1c
No related branches found
No related tags found
No related merge requests found
...@@ -55,8 +55,8 @@ type Meta struct { ...@@ -55,8 +55,8 @@ type Meta struct {
//******* Groups //******* Groups
type Group struct { type Group struct {
ID uint `json:"-", gorm:"primary_key"` ID uint `json:"-" gorm:"primary_key"`
Name string `json:"name, gorm:"unique;not null"` Name string `json:"name" gorm:"unique;not null"`
} }
func (g Group) String() string { func (g Group) String() string {
...@@ -136,14 +136,14 @@ func (g Group) String() string { ...@@ -136,14 +136,14 @@ func (g Group) String() string {
// } // }
type FileSource struct { type FileSource struct {
ID uint `json:"-", gorm:"primary_key"` ID uint `json:"-" gorm:"primary_key"`
FileName string `json:"filename"` FileName string `json:"filename"`
Hash string `json:"hash"` Hash string `json:"hash"`
// Import Import `json:"import"` // Import Import `json:"import"`
} }
type FileMetadata struct { type FileMetadata struct {
ID uint `hson:"-", gorm:"primary_key"` ID uint `hson:"-" gorm:"primary_key"`
Artist string `json:"artist"` Artist string `json:"artist"`
Title string `json:"title"` Title string `json:"title"`
Album string `json:"album"` Album string `json:"album"`
...@@ -151,11 +151,11 @@ type FileMetadata struct { ...@@ -151,11 +151,11 @@ type FileMetadata struct {
} }
type File struct { type File struct {
ID uint `json:"id", gorm:"primary_key"` ID uint `json:"id" gorm:"primary_key"`
CreatedAt time.Time `json:"created"` CreatedAt time.Time `json:"created"`
UpdatedAt time.Time `json:"updated"` UpdatedAt time.Time `json:"updated"`
GroupName string `json:"group"` GroupName string `json:"group"`
Group Group `json:"-", gorm:"association_foreignkey:Name"` Group Group `json:"-" gorm:"association_foreignkey:Name"`
Source FileSource `json:"source"` Source FileSource `json:"source"`
SourceID uint `json:"-"` SourceID uint `json:"-"`
Metadata FileMetadata `json:"metadata"` Metadata FileMetadata `json:"metadata"`
...@@ -176,7 +176,7 @@ type PlaylistEntry struct { ...@@ -176,7 +176,7 @@ type PlaylistEntry struct {
} }
type Playlist struct { type Playlist struct {
ID uint `json:"id", gorm:"primary_key"` ID uint `json:"id" gorm:"primary_key"`
CreatedAt time.Time `json:"created"` CreatedAt time.Time `json:"created"`
UpdatedAt time.Time `json:"updated"` UpdatedAt time.Time `json:"updated"`
PlaylistEntries []PlaylistEntry PlaylistEntries []PlaylistEntry
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment