feat(subsonic): add avatar support

closes: #228
This commit is contained in:
Brian Doherty
2022-07-20 23:16:13 +01:00
committed by sentriz
parent 7ab378accb
commit 5e66261f0c
15 changed files with 288 additions and 28 deletions

View File

@@ -43,6 +43,7 @@ func (db *DB) Migrate(ctx MigrationContext) error {
construct(ctx, "202202241218", migratePublicPlaylist),
construct(ctx, "202204270903", migratePodcastDropUserID),
construct(ctx, "202206011628", migrateInternetRadioStations),
construct(ctx, "202206101425", migrateUser),
}
return gormigrate.
@@ -363,3 +364,10 @@ func migrateInternetRadioStations(tx *gorm.DB, _ MigrationContext) error {
).
Error
}
func migrateUser(tx *gorm.DB, _ MigrationContext) error {
return tx.AutoMigrate(
User{},
).
Error
}

View File

@@ -172,6 +172,7 @@ type User struct {
ListenBrainzURL string `sql:"default: null"`
ListenBrainzToken string `sql:"default: null"`
IsAdmin bool `sql:"default: null"`
Avatar []byte `sql:"default: null"`
}
type Setting struct {
@@ -398,10 +399,10 @@ type Bookmark struct {
}
type InternetRadioStation struct {
ID int `gorm:"primary_key"`
StreamURL string
Name string
HomepageURL string
ID int `gorm:"primary_key"`
StreamURL string
Name string
HomepageURL string
}
func (ir *InternetRadioStation) SID() *specid.ID {