Fix sample check rd
This commit is contained in:
@@ -113,7 +113,7 @@ func flattenFiles(files []MagnetFile, parentPath string, index *int) map[string]
|
||||
fileName := filepath.Base(f.Name)
|
||||
|
||||
// Skip sample files
|
||||
if utils.IsSampleFile(fileName) {
|
||||
if utils.IsSampleFile(f.Name) {
|
||||
continue
|
||||
}
|
||||
if !cfg.IsAllowedFile(fileName) {
|
||||
|
||||
@@ -51,14 +51,13 @@ func getTorrentFiles(t *types.Torrent, data TorrentInfo, validate bool) map[stri
|
||||
cfg := config.GetConfig()
|
||||
idx := 0
|
||||
for _, f := range data.Files {
|
||||
|
||||
name := filepath.Base(f.Path)
|
||||
|
||||
if validate {
|
||||
if utils.RegexMatch(utils.SAMPLEMATCH, name) {
|
||||
if utils.IsSampleFile(f.Path) {
|
||||
// Skip sample files
|
||||
continue
|
||||
}
|
||||
|
||||
if !cfg.IsAllowedFile(name) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ func (tb *Torbox) UpdateTorrent(t *types.Torrent) error {
|
||||
cfg := config.GetConfig()
|
||||
for _, f := range data.Files {
|
||||
fileName := filepath.Base(f.Name)
|
||||
if utils.IsSampleFile(fileName) {
|
||||
if utils.IsSampleFile(f.AbsolutePath) {
|
||||
// Skip sample files
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user