From d6467ce4ecc6e8f76635aa56e4f0d4bb662de65a Mon Sep 17 00:00:00 2001 From: Audionut Date: Thu, 17 Oct 2024 07:42:00 +1000 Subject: [PATCH] Argument to ensure no edition --- src/args.py | 1 + src/prep.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/args.py b/src/args.py index 117a38da..82a175f8 100644 --- a/src/args.py +++ b/src/args.py @@ -40,6 +40,7 @@ def parse(self, args, meta): parser.add_argument('--no-aka', dest='no_aka', action='store_true', required=False, help="Remove AKA from title") parser.add_argument('--no-dub', dest='no_dub', action='store_true', required=False, help="Remove Dubbed from title") parser.add_argument('--no-tag', dest='no_tag', action='store_true', required=False, help="Remove Group Tag from title") + parser.add_argument('--no-edition', dest='no_edition', action='store_true', required=False, help="Remove Edition from title") parser.add_argument('--dual-audio', dest='dual_audio', action='store_true', required=False, help="Add Dual-Audio to the title") parser.add_argument('-ns', '--no-seed', action='store_true', required=False, help="Do not add torrent to the client") parser.add_argument('-year', '--year', dest='manual_year', nargs='?', required=False, help="Year", type=int, default=0) diff --git a/src/prep.py b/src/prep.py index 077cdaef..3e6da875 100644 --- a/src/prep.py +++ b/src/prep.py @@ -677,10 +677,13 @@ async def gather_prep(self, meta, mode): else: meta['video_encode'], meta['video_codec'], meta['has_encode_settings'], meta['bit_depth'] = self.get_video_encode(mi, meta['type'], bdinfo) - meta['edition'], meta['repack'] = self.get_edition(meta['path'], bdinfo, meta['filelist'], meta.get('manual_edition')) - if "REPACK" in meta.get('edition', ""): - meta['repack'] = re.search(r"REPACK[\d]?", meta['edition'])[0] - meta['edition'] = re.sub(r"REPACK[\d]?", "", meta['edition']).strip().replace(' ', ' ') + if meta.get('no_edition') is False: + meta['edition'], meta['repack'] = self.get_edition(meta['path'], bdinfo, meta['filelist'], meta.get('manual_edition')) + if "REPACK" in meta.get('edition', ""): + meta['repack'] = re.search(r"REPACK[\d]?", meta['edition'])[0] + meta['edition'] = re.sub(r"REPACK[\d]?", "", meta['edition']).strip().replace(' ', ' ') + else: + meta['edition'] = "" # WORK ON THIS meta.get('stream', False)