Some improvements to beta

This commit is contained in:
Mukhtar Akere
2025-06-07 10:03:01 +01:00
parent dfcf8708f1
commit 84603b084b
8 changed files with 38 additions and 27 deletions

View File

@@ -245,6 +245,7 @@ func (h *Handler) OpenFile(ctx context.Context, name string, flag int, perm os.F
size: file.Size,
link: file.Link,
metadataOnly: metadataOnly,
isRar: file.IsRar,
modTime: cached.AddedOn,
}, nil
}
@@ -409,6 +410,8 @@ func (h *Handler) serveDirectory(w http.ResponseWriter, r *http.Request, file we
}
}
// Handlers
func (h *Handler) handleGet(w http.ResponseWriter, r *http.Request) {
fRaw, err := h.OpenFile(r.Context(), r.URL.Path, os.O_RDONLY, 0)
if err != nil {
@@ -458,7 +461,8 @@ func (h *Handler) handleGet(w http.ResponseWriter, r *http.Request) {
return
}
file.downloadLink = link
if h.cache.StreamWithRclone() {
// If the torrent file is not a RAR file and users enabled proxy streaming
if !file.isRar && h.cache.StreamWithRclone() {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")