Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 290d79ef5e | |||
| aa0b8275e7 | |||
| c369b13fae | |||
| bef915ac6d |
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
name: Build
|
name: Build
|
||||||
run-name: ${{ gitea.actor }} is runs ci pipeline
|
|
||||||
#on:
|
#on:
|
||||||
# release:
|
# release:
|
||||||
# types: [published]
|
# types: [published]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
name: Publish
|
name: Publish
|
||||||
run-name: ${{ gitea.actor }} is runs ci pipeline
|
|
||||||
#on:
|
#on:
|
||||||
# release:
|
# release:
|
||||||
# types: [published]
|
# types: [published]
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ FROM golang:1.23-alpine
|
|||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
VOLUME /sorted
|
VOLUME /sorted
|
||||||
VOLUME /frontend
|
VOLUME /frontend
|
||||||
|
VOLUME /characters
|
||||||
|
|
||||||
ENV PORT 8080
|
ENV PORT 8080
|
||||||
ENV DB_HOST ""
|
ENV DB_HOST ""
|
||||||
@@ -29,6 +30,7 @@ ENV DB_USERNAME ""
|
|||||||
ENV DB_PASSWORD ""
|
ENV DB_PASSWORD ""
|
||||||
ENV DB_NAME ""
|
ENV DB_NAME ""
|
||||||
ENV MUSIC_PATH ""
|
ENV MUSIC_PATH ""
|
||||||
|
ENV CHARACTERS_PATH ""
|
||||||
|
|
||||||
COPY --from=build_go /app/main .
|
COPY --from=build_go /app/main .
|
||||||
COPY ./songs/ ./songs/
|
COPY ./songs/ ./songs/
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package backend
|
package backend
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -8,6 +9,10 @@ import (
|
|||||||
|
|
||||||
func GetCharacterList() []string {
|
func GetCharacterList() []string {
|
||||||
charactersPath := os.Getenv("CHARACTERS_PATH")
|
charactersPath := os.Getenv("CHARACTERS_PATH")
|
||||||
|
fmt.Printf("dir: %s\n", charactersPath)
|
||||||
|
if !strings.HasSuffix(charactersPath, "/") {
|
||||||
|
charactersPath += "/"
|
||||||
|
}
|
||||||
files, err := os.ReadDir(charactersPath)
|
files, err := os.ReadDir(charactersPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@@ -24,7 +29,11 @@ func GetCharacterList() []string {
|
|||||||
|
|
||||||
func GetCharacter(character string) string {
|
func GetCharacter(character string) string {
|
||||||
charactersPath := os.Getenv("CHARACTERS_PATH")
|
charactersPath := os.Getenv("CHARACTERS_PATH")
|
||||||
return charactersPath + "/" + character
|
fmt.Printf("dir: %s\n", charactersPath)
|
||||||
|
if !strings.HasSuffix(charactersPath, "/") {
|
||||||
|
charactersPath += "/"
|
||||||
|
}
|
||||||
|
return charactersPath + character
|
||||||
}
|
}
|
||||||
|
|
||||||
func isImage(entry os.DirEntry) bool {
|
func isImage(entry os.DirEntry) bool {
|
||||||
|
|||||||
@@ -87,11 +87,11 @@ func SyncProgress() ProgressResponse {
|
|||||||
timeSpent = currentTime.Sub(start)
|
timeSpent = currentTime.Sub(start)
|
||||||
out := time.Time{}.Add(timeSpent)
|
out := time.Time{}.Add(timeSpent)
|
||||||
fmt.Printf("\nTime spent: %v\n", timeSpent)
|
fmt.Printf("\nTime spent: %v\n", timeSpent)
|
||||||
fmt.Printf("Total time: %v\n", out.Format("15:04:05.00000"))
|
fmt.Printf("Time spent: %v\n", out.Format("15:04:05.00000"))
|
||||||
log.Printf("Progress: %v/%v %v%%\n", int(foldersSynced), int(numberOfFoldersToSync), progress)
|
log.Printf("Progress: %v/%v %v%%\n", int(foldersSynced), int(numberOfFoldersToSync), progress)
|
||||||
return ProgressResponse{
|
return ProgressResponse{
|
||||||
Progress: fmt.Sprintf("%v", progress),
|
Progress: fmt.Sprintf("%v", progress),
|
||||||
TimeSpent: fmt.Sprintf("%v", timeSpent),
|
TimeSpent: out.Format("15:04:05"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ func SyncResult() SyncResponse {
|
|||||||
GamesChangedContent: gamesChangedContent,
|
GamesChangedContent: gamesChangedContent,
|
||||||
GamesRemoved: gamesRemoved,
|
GamesRemoved: gamesRemoved,
|
||||||
CatchedErrors: catchedErrors,
|
CatchedErrors: catchedErrors,
|
||||||
TotalTime: fmt.Sprintf("%v", timeSpent),
|
TotalTime: out.Format("15:04:05"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ func InitDB(host string, port string, user string, password string, dbname strin
|
|||||||
_, _ = fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err)
|
_, _ = fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
Testf()
|
|
||||||
fmt.Println(success)
|
fmt.Println(success)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user