diff --git a/backend/graph/generated.go b/backend/graph/generated.go index d839582..6b031d7 100644 --- a/backend/graph/generated.go +++ b/backend/graph/generated.go @@ -2917,9 +2917,9 @@ func (ec *executionContext) _Query_spotifyRecent(ctx context.Context, field grap return ec.Resolvers.Query().SpotifyRecent(ctx) }, nil, - ec.marshalNSpotifyRecentItem2ᚕᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItemᚄ, - true, + ec.marshalOSpotifyRecentItem2ᚕᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItemᚄ, true, + false, ) } @@ -6348,16 +6348,13 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "spotifyRecent": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { + innerFunc := func(ctx context.Context, _ *graphql.FieldSet) (res graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) } }() res = ec._Query_spotifyRecent(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } return res } @@ -7586,22 +7583,6 @@ func (ec *executionContext) marshalNSpotifyImage2ᚖadamᚑfrenchᚗcoᚗukᚋba return ec._SpotifyImage(ctx, sel, v) } -func (ec *executionContext) marshalNSpotifyRecentItem2ᚕᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItemᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SpotifyRecentItem) graphql.Marshaler { - ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { - fc := graphql.GetFieldContext(ctx) - fc.Result = &v[i] - return ec.marshalNSpotifyRecentItem2ᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItem(ctx, sel, v[i]) - }) - - for _, e := range ret { - if e == graphql.Null { - return graphql.Null - } - } - - return ret -} - func (ec *executionContext) marshalNSpotifyRecentItem2ᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItem(ctx context.Context, sel ast.SelectionSet, v *model.SpotifyRecentItem) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { @@ -7881,6 +7862,25 @@ func (ec *executionContext) marshalOSpotifyPlaying2ᚖadamᚑfrenchᚗcoᚗukᚋ return ec._SpotifyPlaying(ctx, sel, v) } +func (ec *executionContext) marshalOSpotifyRecentItem2ᚕᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItemᚄ(ctx context.Context, sel ast.SelectionSet, v []*model.SpotifyRecentItem) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := graphql.MarshalSliceConcurrently(ctx, len(v), 0, false, func(ctx context.Context, i int) graphql.Marshaler { + fc := graphql.GetFieldContext(ctx) + fc.Result = &v[i] + return ec.marshalNSpotifyRecentItem2ᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyRecentItem(ctx, sel, v[i]) + }) + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + func (ec *executionContext) marshalOSpotifyTrack2ᚖadamᚑfrenchᚗcoᚗukᚋbackendᚋgraphᚋmodelᚐSpotifyTrack(ctx context.Context, sel ast.SelectionSet, v *model.SpotifyTrack) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/backend/graph/schema.resolvers.go b/backend/graph/schema.resolvers.go index 934cf8a..7970301 100644 --- a/backend/graph/schema.resolvers.go +++ b/backend/graph/schema.resolvers.go @@ -392,7 +392,7 @@ func (r *queryResolver) Messages(ctx context.Context) ([]*models.Message, error) // SpotifyListening is the resolver for the spotifyListening field. func (r *queryResolver) SpotifyListening(ctx context.Context) (*model.SpotifyPlaying, error) { if r.Store.SpotifyClient == nil { - return nil, fmt.Errorf("Spotify not authenticated") + return nil, nil } playing, err := r.Store.SpotifyClient.PlayerCurrentlyPlaying(ctx) @@ -411,7 +411,7 @@ func (r *queryResolver) SpotifyListening(ctx context.Context) (*model.SpotifyPla // SpotifyRecent is the resolver for the spotifyRecent field. func (r *queryResolver) SpotifyRecent(ctx context.Context) ([]*model.SpotifyRecentItem, error) { if r.Store.SpotifyClient == nil { - return nil, fmt.Errorf("Spotify not authenticated") + return []*model.SpotifyRecentItem{}, nil } if r.Store.RecentSongsFresh() { diff --git a/backend/graph/schema/schema.graphql b/backend/graph/schema/schema.graphql index 43cd9c3..da04845 100644 --- a/backend/graph/schema/schema.graphql +++ b/backend/graph/schema/schema.graphql @@ -10,7 +10,7 @@ type Query { rowingSessions: [Rowing!]! messages: [Message!]! spotifyListening: SpotifyPlaying - spotifyRecent: [SpotifyRecentItem!]! + spotifyRecent: [SpotifyRecentItem!] giteaFeed: GiteaFeedItem me: User } diff --git a/icecast2/.dockerignore b/icecast2/.dockerignore new file mode 100644 index 0000000..7367535 --- /dev/null +++ b/icecast2/.dockerignore @@ -0,0 +1 @@ +fallback_music/ diff --git a/vue/src/stores/homeData.js b/vue/src/stores/homeData.js index 9a467a5..acc00db 100644 --- a/vue/src/stores/homeData.js +++ b/vue/src/stores/homeData.js @@ -35,7 +35,7 @@ export const useHomeDataStore = defineStore("homeData", () => { posts.value = data.posts; favorites.value = data.favorites; activities.value = data.activities; - spotifyRecent.value = data.spotifyRecent; + spotifyRecent.value = data.spotifyRecent || []; rowingSessions.value = data.rowingSessions; gitFeed.value = data.giteaFeed || null; me.value = data.me || null;