Add add_samples to available flags

This commit is contained in:
Mukhtar Akere
2025-05-22 15:14:31 +01:00
parent 57ccd67c83
commit a2bdad7c2a
7 changed files with 43 additions and 47 deletions

View File

@@ -33,7 +33,8 @@ type Torbox struct {
MountPath string
logger zerolog.Logger
CheckCached bool
checkCached bool
addSamples bool
}
func New(dc config.Debrid) *Torbox {
@@ -70,7 +71,8 @@ func New(dc config.Debrid) *Torbox {
client: client,
MountPath: dc.Folder,
logger: _log,
CheckCached: dc.CheckCached,
checkCached: dc.CheckCached,
addSamples: dc.AddSamples,
}
}
@@ -216,7 +218,7 @@ func (tb *Torbox) GetTorrent(torrentId string) (*types.Torrent, error) {
cfg := config.Get()
for _, f := range data.Files {
fileName := filepath.Base(f.Name)
if utils.IsSampleFile(f.AbsolutePath) {
if !tb.addSamples && utils.IsSampleFile(f.AbsolutePath) {
// Skip sample files
continue
}
@@ -277,7 +279,7 @@ func (tb *Torbox) UpdateTorrent(t *types.Torrent) error {
cfg := config.Get()
for _, f := range data.Files {
fileName := filepath.Base(f.Name)
if utils.IsSampleFile(f.AbsolutePath) {
if !tb.addSamples && utils.IsSampleFile(f.AbsolutePath) {
// Skip sample files
continue
}
@@ -431,7 +433,7 @@ func (tb *Torbox) GetDownloadingStatus() []string {
}
func (tb *Torbox) GetCheckCached() bool {
return tb.CheckCached
return tb.checkCached
}
func (tb *Torbox) GetTorrents() ([]*types.Torrent, error) {