Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat(subsonic): add avatar support
closes: #228
  • Loading branch information
brian-doherty authored and sentriz committed Jul 20, 2022
1 parent 7ab378a commit 5e66261
Show file tree
Hide file tree
Showing 15 changed files with 288 additions and 28 deletions.
8 changes: 8 additions & 0 deletions db/migrations.go
Expand Up @@ -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.
Expand Down Expand Up @@ -363,3 +364,10 @@ func migrateInternetRadioStations(tx *gorm.DB, _ MigrationContext) error {
).
Error
}

func migrateUser(tx *gorm.DB, _ MigrationContext) error {
return tx.AutoMigrate(
User{},
).
Error
}
9 changes: 5 additions & 4 deletions db/model.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
36 changes: 25 additions & 11 deletions go.mod
Expand Up @@ -7,44 +7,58 @@ require (
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible
github.com/PuerkitoBio/goquery v1.8.0 // indirect
github.com/cespare/xxhash v1.1.0
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/disintegration/imaging v1.6.2
github.com/dustin/go-humanize v1.0.0
github.com/faiface/beep v1.1.0
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.8.0
github.com/gorilla/securecookie v1.1.1
github.com/gorilla/sessions v1.2.1
github.com/hajimehoshi/go-mp3 v0.3.2 // indirect
github.com/hajimehoshi/go-mp3 v0.3.3 // indirect
github.com/hajimehoshi/oto v1.0.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/icza/bitio v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jinzhu/gorm v1.9.17-0.20211120011537-5c235b72a414
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.2 // indirect
github.com/josephburnett/jd v0.0.0-20191228205456-aa1a7c66b42f
github.com/josephburnett/jd v1.5.2
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/lib/pq v1.3.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matryer/is v1.4.0
github.com/mattn/go-sqlite3 v1.14.11
github.com/mattn/go-sqlite3 v1.14.13
github.com/mewkiz/flac v1.0.7 // indirect
github.com/mewkiz/pkg v0.0.0-20211102230744-16a6ce8f1b77 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mmcdole/gofeed v1.1.3
github.com/mmcdole/goxpp v0.0.0-20200921145534-2f3784f67354 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/nicksellen/audiotags v0.0.0-20160226222119-94015fa599bd
github.com/oklog/run v1.1.0
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
github.com/peterbourgon/ff v1.7.1
github.com/pkg/errors v0.9.1 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be
github.com/sentriz/gormstore v0.0.0-20220105134332-64e31f7f6981
github.com/stretchr/testify v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20220209155544-dad33157f4bf // indirect
golang.org/x/exp/shiny v0.0.0-20220407100705-7b9b53b0aca4 // indirect
golang.org/x/image v0.0.0-20211028202545-6944b10bf410 // indirect
golang.org/x/mobile v0.0.0-20220112015953-858099ff7816 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220207234003-57398862261d // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/exp/shiny v0.0.0-20220609121020-a51bd0440498 // indirect
golang.org/x/image v0.0.0-20220601225756-64ec528b34cd // indirect
golang.org/x/mobile v0.0.0-20220518205345-8578da9835fd // indirect
golang.org/x/net v0.0.0-20220607020251-c690dde0001d // indirect
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/gormigrate.v1 v1.6.0
gopkg.in/yaml.v2 v2.4.0 // indirect
)

0 comments on commit 5e66261

Please sign in to comment.