Migrate to full rclone rcd

This commit is contained in:
Mukhtar Akere
2025-08-08 05:22:52 +01:00
parent eba24c9d63
commit 6f9fafd7d8
17 changed files with 1363 additions and 900 deletions

View File

@@ -6,7 +6,7 @@ import (
"context"
"errors"
"fmt"
"github.com/sirrobot01/decypharr/pkg/mount"
"github.com/sirrobot01/decypharr/pkg/rclone"
"os"
"path"
"path/filepath"
@@ -107,10 +107,10 @@ type Cache struct {
config config.Debrid
customFolders []string
mounter *mount.Mount
mounter *rclone.Mount
}
func NewDebridCache(dc config.Debrid, client types.Client, mounter *mount.Mount) *Cache {
func NewDebridCache(dc config.Debrid, client types.Client, mounter *rclone.Mount) *Cache {
cfg := config.Get()
cet, err := time.LoadLocation("CET")
if err != nil {

View File

@@ -29,6 +29,12 @@ func (fi *fileInfo) IsDir() bool { return fi.isDir }
func (fi *fileInfo) ID() string { return fi.id }
func (fi *fileInfo) Sys() interface{} { return nil }
type RcloneRC struct {
URL string
User string
Pass string
}
func (c *Cache) RefreshListings(refreshRclone bool) {
// Copy the torrents to a string|time map
c.torrents.refreshListing() // refresh torrent listings
@@ -147,10 +153,6 @@ func (c *Cache) refreshRcloneWithRC(dirs []string) error {
return nil
}
if cfg.RcUrl == "" {
return nil
}
client := http.DefaultClient
// Create form data
data := c.buildRcloneRequestData(dirs)