Add VidHub endpoints

This commit is contained in:
Ben Adrian Sarmiento
2024-07-11 15:53:20 +02:00
parent f8f68e8225
commit 396a8781aa
10 changed files with 182 additions and 86 deletions

View File

@@ -28,6 +28,7 @@ type RootResponse struct {
Html string `json:"html"`
Dav string `json:"dav"`
Infuse string `json:"infuse"`
VidHub string `json:"vidhub"`
Logs string `json:"logs"`
UserInfo *realdebrid.User `json:"user_info"`
LibrarySize int `json:"library_size"` // Number of torrents in the library
@@ -104,6 +105,7 @@ func (zr *Handlers) generateResponse(resp http.ResponseWriter, req *http.Request
Html: fmt.Sprintf("//%s/http/", req.Host),
Dav: fmt.Sprintf("//%s/dav/", req.Host),
Infuse: fmt.Sprintf("//%s/infuse/", req.Host),
VidHub: fmt.Sprintf("//%s/vidhub/", req.Host),
Logs: fmt.Sprintf("//%s/logs/", req.Host),
UserInfo: userInfo,
TrafficServedPerAPI: trafficFromAPI,
@@ -255,6 +257,10 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
<td>Infuse</td>
<td colspan="2"><a href="%s">%s</a></td>
</tr>
<tr>
<td>VidHub</td>
<td colspan="2"><a href="%s">%s</a></td>
</tr>
<tr>
<td>Logs</td>
<td colspan="2"><a href="%s">%s</a></td>
@@ -268,6 +274,8 @@ func (zr *Handlers) handleHome(resp http.ResponseWriter, req *http.Request) {
response.Dav,
response.Infuse,
response.Infuse,
response.VidHub,
response.VidHub,
response.Logs,
response.Logs,
)