diff --git a/src/trackers/HDB.py b/src/trackers/HDB.py index e7f0b21fd..5d703c7b5 100644 --- a/src/trackers/HDB.py +++ b/src/trackers/HDB.py @@ -236,6 +236,7 @@ async def upload(self, meta, disctype): # Create a new torrent with piece size explicitly set to 16 MiB new_torrent = prep.CustomTorrent( + meta=meta, path=Path(meta['path']), trackers=["https://fake.tracker"], source="L4G", diff --git a/src/trackers/PTP.py b/src/trackers/PTP.py index b1e9a6909..41865687a 100644 --- a/src/trackers/PTP.py +++ b/src/trackers/PTP.py @@ -619,9 +619,6 @@ async def edit_desc(self, meta): prep = Prep(screens=meta['screens'], img_host=meta['imghost'], config=self.config) base = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/DESCRIPTION.txt", 'r', encoding="utf-8").read() multi_screens = int(self.config['DEFAULT'].get('multiScreens', 2)) - if multi_screens < 2: - multi_screens = 2 - console.print("[yellow]PTP requires at least 2 screenshots for multi disc/file content, overriding config") with open(f"{meta['base_dir']}/tmp/{meta['uuid']}/[{self.tracker}]DESCRIPTION.txt", 'w', encoding="utf-8") as desc: images = meta['image_list'] @@ -659,6 +656,9 @@ async def edit_desc(self, meta): elif len(discs) > 1: if 'retry_count' not in meta: meta['retry_count'] = 0 + if multi_screens < 2: + multi_screens = 2 + console.print("[yellow]PTP requires at least 2 screenshots for multi disc content, overriding config") for i, each in enumerate(discs): new_images_key = f'new_images_disc_{i}' if each['type'] == "BDMV": @@ -776,6 +776,9 @@ async def edit_desc(self, meta): # Handle multiple files case elif len(filelist) > 1: + if multi_screens < 2: + multi_screens = 2 + console.print("[yellow]PTP requires at least 2 screenshots for multi disc/file content, overriding config") for i in range(len(filelist)): file = filelist[i] if i == 0: @@ -986,6 +989,7 @@ async def upload(self, meta, url, data, disctype): from src.prep import Prep prep = Prep(screens=meta['screens'], img_host=meta['imghost'], config=self.config) new_torrent = prep.CustomTorrent( + meta=meta, path=Path(meta['path']), trackers=[self.announce_url], source="L4G",