Skip to content

Commit

Permalink
Change name to syncify
Browse files Browse the repository at this point in the history
  • Loading branch information
thechubbypanda committed Jun 16, 2024
1 parent 162dfd1 commit dcb7ab2
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
spotisync:
# image: ghcr.io/thechubbypanda/spotisync:main
syncify:
# image: ghcr.io/thechubbypanda/syncify:main
build: .
env_file:
- .env
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/thechubbypanda/spotisync
module github.com/thechubbypanda/syncify

go 1.22.3

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
10 changes: 5 additions & 5 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion views/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]")),
Expand Down
4 changes: 2 additions & 2 deletions views/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down Expand Up @@ -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)
}

0 comments on commit dcb7ab2

Please sign in to comment.