From ae6d27a4548595ac8d4449cc63fe91b196be5600 Mon Sep 17 00:00:00 2001 From: lededev Date: Thu, 14 Apr 2022 01:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F3=E5=A2=9E=E5=8A=A0=E4=B8=80=E6=9D=A1.nfo?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Movie_Data_Capture.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Movie_Data_Capture.py b/Movie_Data_Capture.py index 2c8a5a2..e5f2f68 100644 --- a/Movie_Data_Capture.py +++ b/Movie_Data_Capture.py @@ -356,12 +356,17 @@ def movie_lists(source_folder, regexstr: str) -> typing.List[str]: continue if cliRE and not cliRE.search(absf) or trailerRE.search(full_name.name): continue - if main_mode == 3 and nfo_skip_days > 0 and file_modification_days( - full_name.with_suffix('.nfo')) <= nfo_skip_days: - skip_nfo_days_cnt += 1 - if debug: - print(f"[!]Skip movie by it's .nfo which modified within {nfo_skip_days} days: '{absf}'") - continue + if main_mode == 3: + nfo = full_name.with_suffix('.nfo') + if not nfo.is_file(): + if debug: + print(f"[!]Metadata {nfo.name} not found for '{absf}'") + continue + if nfo_skip_days > 0 and file_modification_days(nfo) <= nfo_skip_days: + skip_nfo_days_cnt += 1 + if debug: + print(f"[!]Skip movie by it's .nfo which modified within {nfo_skip_days} days: '{absf}'") + continue total.append(absf) if skip_failed_cnt: