Add sponsorship links

This commit is contained in:
Ben Sarmiento
2023-12-02 19:37:35 +01:00
parent a89e0ce8b0
commit a59db03479

View File

@@ -177,6 +177,11 @@ func (zr *ZurgRouter) headFileHandler(resp http.ResponseWriter, req *http.Reques
universal.HandleHeadRequest(directory, torrentName, fileName, resp, req, zr.torMgr, zr.log)
}
type SponsorResponse struct {
Patreon string `json:"patreon"`
Github string `json:"github"`
Paypal string `json:"paypal"`
}
type RootResponse struct {
Version string `json:"version"`
BuiltAt string `json:"built_at"`
@@ -190,6 +195,7 @@ type RootResponse struct {
Sys uint64 `json:"sys"` // System memory in MB
NumGC uint32 `json:"num_gc"` // Number of completed GC cycles
PID int `json:"pid"` // Process ID
Sponsor SponsorResponse `json:"sponsor_this_project"` // Process ID
}
func (zr *ZurgRouter) rootHandler(resp http.ResponseWriter, req *http.Request, params httprouter.Params) {
@@ -215,6 +221,11 @@ func (zr *ZurgRouter) rootHandler(resp http.ResponseWriter, req *http.Request, p
Sys: bToMb(mem.Sys),
NumGC: mem.NumGC,
PID: os.Getpid(),
Sponsor: SponsorResponse{
Patreon: "https://www.patreon.com/debridmediamanager",
Github: "https://github.com/sponsors/debridmediamanager",
Paypal: "https://paypal.me/yowmamasita",
},
}
if err := json.NewEncoder(resp).Encode(response); err != nil {