diff --git a/Dockerfile b/Dockerfile index e38a5fe..5731ef2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,14 +4,14 @@ WORKDIR /build COPY . . -RUN go build -o out/spotisync . +RUN go build -o out/syncify . FROM docker.io/library/alpine:latest WORKDIR /app -COPY --from=build /build/out/spotisync /bin/ +COPY --from=build /build/out/syncify /bin/ COPY static static -CMD ["spotisync"] +CMD ["syncify"] diff --git a/compose.yml b/compose.yml index e3690cf..3014982 100644 --- a/compose.yml +++ b/compose.yml @@ -1,6 +1,6 @@ services: - spotisync: -# image: ghcr.io/thechubbypanda/spotisync:main + syncify: +# image: ghcr.io/thechubbypanda/syncify:main build: . env_file: - .env diff --git a/go.mod b/go.mod index e86d444..d997798 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/thechubbypanda/spotisync +module github.com/thechubbypanda/syncify go 1.22.3 diff --git a/main.go b/main.go index 3034015..780d284 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( "github.com/go-chi/chi/v5/middleware" "github.com/ilyakaznacheev/cleanenv" "github.com/sirupsen/logrus" - "github.com/thechubbypanda/spotisync/views" + "github.com/thechubbypanda/syncify/views" "github.com/zmb3/spotify/v2" "github.com/zmb3/spotify/v2/auth" "golang.org/x/oauth2" @@ -39,7 +39,7 @@ func main() { sm.Cookie.Secure = false sm.Cookie.HttpOnly = true sm.Cookie.Persist = false - sm.Cookie.Name = "spotisync_session" + sm.Cookie.Name = "syncify_session" sm.Cookie.SameSite = http.SameSiteLaxMode r := chi.NewRouter() diff --git a/sync.go b/sync.go index 3b45bf5..e333847 100644 --- a/sync.go +++ b/sync.go @@ -3,7 +3,7 @@ package main import ( "errors" "github.com/sirupsen/logrus" - "github.com/thechubbypanda/spotisync/views" + "github.com/thechubbypanda/syncify/views" "github.com/zmb3/spotify/v2" spotifyauth "github.com/zmb3/spotify/v2/auth" "golang.org/x/oauth2" @@ -44,7 +44,7 @@ func getPlaylist(r *http.Request, s *spotify.Client, user *spotify.PrivateUser) } logrus.Traceln(user.ID, ":", "reading page", 0, " of liked songs") for _, p := range playlists.Playlists { - if p.Name == "SpotiSync" { + if p.Name == "Syncify" { return &p, nil } } @@ -59,13 +59,13 @@ func getPlaylist(r *http.Request, s *spotify.Client, user *spotify.PrivateUser) } logrus.Traceln(user.ID, ":", "reading page", page, " of liked songs") for _, p := range playlists.Playlists { - if p.Name == "SpotiSync" { + if p.Name == "Syncify" { return &p, nil } } } - playlist, err := s.CreatePlaylistForUser(r.Context(), user.ID, "SpotiSync", "A copy of your 'Liked Songs' playlist by SpotiSync", false, false) + playlist, err := s.CreatePlaylistForUser(r.Context(), user.ID, "Syncify", "A copy of your 'Liked Songs' playlist by Syncify", false, false) if err != nil { return nil, err } @@ -161,7 +161,7 @@ func sync(r *http.Request, token *oauth2.Token) (int, error) { } } - logrus.Debugln(user.ID, ":", "sync complete") + logrus.Infoln(user.ID, ":", "sync complete for", len(trackIds), "songs") return len(trackIds), nil } diff --git a/views/page.go b/views/page.go index 53abaaf..dae8fa7 100644 --- a/views/page.go +++ b/views/page.go @@ -8,7 +8,7 @@ import ( func Page(contents ...g.Node) g.Node { return c.HTML5(c.HTML5Props{ - Title: "SpotiSync", + Title: "Syncify", Language: "en", Head: []g.Node{ Script(Src("https://unpkg.com/htmx.org@1.9.12")), diff --git a/views/root.go b/views/root.go index 044b665..6951d1b 100644 --- a/views/root.go +++ b/views/root.go @@ -13,7 +13,7 @@ func Root(user *spotify.PrivateUser, count int, err error) g.Node { return Page( Div(Class("flex flex-col items-center justify-center h-screen gap-6"), Div(Class("flex flex-col items-center gap-2"), - H1(Class("text-3xl font-bold"), g.Text("SpotiSync")), + H1(Class("text-3xl font-bold"), g.Text("Syncify")), P(Class("text-lg text-gray-600"), g.Text("Sync your Spotify 'Liked Songs' playlist to a sharable one.")), UserText(user), ), @@ -74,7 +74,7 @@ func Outcome(count int, err error) g.Node { } else if err != nil { o = g.Text("Error: " + err.Error()) } else { - o = g.Text("Successfully synchronized " + strconv.Itoa(count) + " tracks to your SpotiSync playlist") + o = g.Text("Successfully synchronized " + strconv.Itoa(count) + " tracks to your Syncify playlist") } return Div(ID("outcome"), Class("text-gray-500"), o) }