Skip to content

Commit

Permalink
Merge branch 'Audionut:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberio87 authored Sep 28, 2024
2 parents de3f285 + 08db864 commit 92826a9
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -2458,17 +2458,14 @@ def validate_piece_size(self):
def create_torrent(self, meta, path, output_filename):
# Handle directories and file inclusion logic
if meta['isdir']:
if meta['keep_folder']:
cli_ui.info('--keep-folder was specified. Using complete folder for torrent creation.')
else:
os.chdir(path)
globs = glob.glob1(path, "*.mkv") + glob.glob1(path, "*.mp4") + glob.glob1(path, "*.ts")
no_sample_globs = []
for file in globs:
if not file.lower().endswith('sample.mkv') or "!sample" in file.lower():
no_sample_globs.append(os.path.abspath(f"{path}{os.sep}{file}"))
if len(no_sample_globs) == 1:
path = meta['filelist'][0]
os.chdir(path)
globs = glob.glob1(path, "*.mkv") + glob.glob1(path, "*.mp4") + glob.glob1(path, "*.ts")
no_sample_globs = []
for file in globs:
if not file.lower().endswith('sample.mkv') or "!sample" in file.lower():
no_sample_globs.append(os.path.abspath(f"{path}{os.sep}{file}"))
if len(no_sample_globs) == 1:
path = meta['filelist'][0]
if meta['is_disc']:
include, exclude = "", ""
else:
Expand Down

0 comments on commit 92826a9

Please sign in to comment.