Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar support #228

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a61471b
Initial commit of internet radio support.
brian-doherty Jun 2, 2022
dd8f81e
Added first test for internet radio.
brian-doherty Jun 2, 2022
663d2f9
Refactor to prepare for more test cases.
brian-doherty Jun 2, 2022
5435503
Added a few more tests. Realized that I was not calling as admin so a…
brian-doherty Jun 3, 2022
4180136
Added more internet radio tests. Added proper JSON unmarshaling for ID.
brian-doherty Jun 3, 2022
b53626d
More test cases. Fixed some accidental tabs in files.
brian-doherty Jun 3, 2022
3647f5c
Fixed some more tabs.
brian-doherty Jun 3, 2022
6f363a0
lint fixes
brian-doherty Jun 3, 2022
d1f25c0
Changed placeholder for homepage URL to fit into box.
brian-doherty Jun 4, 2022
ec5ae02
Finished out internet radio test cases. Found a few bad error codes i…
brian-doherty Jun 4, 2022
428e2ec
Realized that delete via website was not checking properly if id exis…
brian-doherty Jun 4, 2022
f7f515e
First implementation. Not working yet but wanted to save before instr…
brian-doherty Jun 11, 2022
d7510d1
Working implementation of avatars.
brian-doherty Jun 11, 2022
ae0ae3c
Fix lint errors.
brian-doherty Jun 11, 2022
12bf38c
Merged from upstream.
brian-doherty Jun 24, 2022
a9f5ff6
More merging from upstream.
brian-doherty Jun 24, 2022
8b1639e
Merge branch 'sentriz-master'
brian-doherty Jun 24, 2022
be5f252
Merge from upstream.
brian-doherty Jun 24, 2022
6b92dbd
Removed a couple of unnecessary changes introduced by VS Code.
brian-doherty Jun 24, 2022
7d0d5f5
Merge pull request #1 from brian-doherty/avatar
brian-doherty Jun 24, 2022
fd1bbd2
Moved delete avatar button to change avatar screen. Took best guess a…
brian-doherty Jun 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
)