Fix rar files, remove srt

This commit is contained in:
Mukhtar Akere
2024-12-27 22:30:36 +01:00
parent e9d3e120f3
commit eeb3a31b05
3 changed files with 13 additions and 9 deletions

View File

@@ -35,9 +35,11 @@ func GetTorrentFiles(data structs.RealDebridTorrentInfo) []TorrentFile {
files := make([]TorrentFile, 0)
for _, f := range data.Files {
name := filepath.Base(f.Path)
if (!common.RegexMatch(common.VIDEOMATCH, name) &&
!common.RegexMatch(common.SUBMATCH, name) &&
!common.RegexMatch(common.MUSICMATCH, name)) || common.RegexMatch(common.SAMPLEMATCH, name) {
if common.RegexMatch(common.SAMPLEMATCH, name) {
// Skip sample files
continue
}
if !common.RegexMatch(common.VIDEOMATCH, name) && !common.RegexMatch(common.MUSICMATCH, name) {
continue
}
fileId := f.ID

View File

@@ -167,9 +167,11 @@ func (r *Torbox) GetTorrent(id string) (*Torrent, error) {
files := make([]TorrentFile, 0)
for _, f := range data.Files {
fileName := filepath.Base(f.Name)
if (!common.RegexMatch(common.VIDEOMATCH, fileName) &&
!common.RegexMatch(common.SUBMATCH, fileName) &&
!common.RegexMatch(common.MUSICMATCH, fileName)) || common.RegexMatch(common.SAMPLEMATCH, fileName) {
if common.RegexMatch(common.SAMPLEMATCH, fileName) {
// Skip sample files
continue
}
if !common.RegexMatch(common.VIDEOMATCH, fileName) && !common.RegexMatch(common.MUSICMATCH, fileName) {
continue
}
file := TorrentFile{

View File

@@ -105,7 +105,7 @@ func (q *QBit) createSymLink(path string, torrentMountPath string, file debrid.T
q.logger.Printf("Failed to create symlink: %s: %v\n", fullPath, err)
}
// Check if the file exists
if !common.FileReady(fullPath) {
q.logger.Printf("Symlink not ready: %s\n", fullPath)
}
//if !common.FileReady(fullPath) {
// q.logger.Printf("Symlink not ready: %s\n", fullPath)
//}
}