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

Save more to database, forego the spotify library wherever possible. #49

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

albe2669
Copy link
Collaborator

@albe2669 albe2669 commented Dec 4, 2024

To whoever has to review this: I'm sorry.........
image

Codebase Restructuring:

I've restructured most of the codebase to better fit with Go community standards, specifically:

  • Moved *.graphql to api/
  • Renamed frontend/ to web/
  • Renamed lib/ to internal/
  • Moved resolvers to internal/
  • Moved utils to internal/

Service Initialization:

Created services:

  • services/spotify.go to handle calling the spotify library
  • services/database.go to handle calling the database
  • services/shared.go to combine the previous two and serve as the service used throughout the codebase
  • services/watcher.go simplifies the code previously used for the player state loop into one place. This also removes a bunch of global variables :)

New Models:

Created album, artist and image model that precisely mimic a subset of the Spotify web API. These serve as the internal representation and shall be used in place of the Spotify library.

track has also been modified extensively to uphold the same properties as the others.

Model binding

model_binding.go serves as the file where external data types meet ours.

closes #7 #45 #46

@albe2669 albe2669 added enhancement New feature or request go Pull requests that update Go code labels Dec 4, 2024
@albe2669 albe2669 requested review from Slug-Boi and Copilot December 4, 2024 22:33
@albe2669 albe2669 self-assigned this Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 110 out of 124 changed files in this pull request and generated no suggestions.

Files not reviewed (14)
  • api/ent.graphql: Language not supported
  • api/playerState.graphql: Language not supported
  • ent/ent.go: Evaluated as low risk
  • cmd/main.go: Evaluated as low risk
  • ent/gql_node.go: Evaluated as low risk
  • ent/hook/hook.go: Evaluated as low risk
  • ent/gql_edge.go: Evaluated as low risk
  • ent/entc.go: Evaluated as low risk
  • ent/album_delete.go: Evaluated as low risk
  • ent/image.go: Evaluated as low risk
  • ent/album/album.go: Evaluated as low risk
  • ent/image/where.go: Evaluated as low risk
  • ent/image_delete.go: Evaluated as low risk
  • ent/artist.go: Evaluated as low risk
@albe2669 albe2669 marked this pull request as draft December 4, 2024 22:38
@albe2669 albe2669 marked this pull request as ready for review December 4, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: create database schema and connect go code using ent
1 participant