Skip to content

Commit

Permalink
transitive commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadiestro committed Nov 23, 2024
1 parent 23dce10 commit 1befeec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions stiller-backend/internal/dbutils/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type StillerFile struct {
OwnerId int `json:"ownerid"`
Typeof StillerFileType `json:"typeof"`
Path string `json:"path"`
Url string `json:"url"`
Filename string `json:"filename"`
Title string `json:"title"`
Description string `json:"description"`
Expand Down
6 changes: 5 additions & 1 deletion stiller-backend/internal/handlers/file/filetree/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"stiller/internal/dbutils"
"stiller/internal/handlers/handleutils"
"stiller/internal/jwtutils"
"strconv"

jsonexp "github.com/go-json-experiment/json"
"github.com/julienschmidt/httprouter"
Expand Down Expand Up @@ -85,10 +86,13 @@ func Nethandler(w http.ResponseWriter, r *http.Request, params httprouter.Params
getfiles_stmt.String(),
&sqlitex.ExecOptions{
ResultFunc: func(stmt *sqlite.Stmt) error {
new_id := int(stmt.GetInt64("id"))

tmp_newf := dbutils.StillerFile{
Id: int(stmt.GetInt64("id")),
Id: new_id,
OwnerId: int(stmt.GetInt64("owner")),
Typeof: dbutils.StillerFileType(stmt.GetInt64("type")),
Url: "https://pandadiestro.xyz/services/stiller/file/dl/" + strconv.Itoa(new_id),
Path: stmt.GetText("path"),
Filename: stmt.GetText("filename"),
Title: stmt.GetText("title"),
Expand Down
2 changes: 2 additions & 0 deletions stiller-backend/internal/handlers/file/upload/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ func NetHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
return
}

new_file.Url = "https://pandadiestro.xyz/services/stiller/file/dl/" + strconv.Itoa(new_file.Id)

w.WriteHeader(http.StatusOK)
jsonexp.MarshalWrite(w, new_file, jsonexp.DefaultOptionsV2())
}
Expand Down

0 comments on commit 1befeec

Please sign in to comment.