mkv-episode-matcher 0.9.6__py3-none-any.whl → 0.9.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mkv-episode-matcher might be problematic. Click here for more details.

@@ -122,6 +122,7 @@ def select_season(seasons):
122
122
  selected_season = seasons[int(choice) - 1]
123
123
  return int(Path(selected_season).name.replace("Season ", ""))
124
124
 
125
+
125
126
  def onboarding(config_path):
126
127
  """Prompt user for all required config values, showing existing as defaults."""
127
128
  config = get_config(config_path) if config_path.exists() else {}
@@ -153,6 +154,7 @@ def onboarding(config_path):
153
154
  )
154
155
  console.print("[bold green]Onboarding complete! Configuration saved.[/bold green]")
155
156
 
157
+
156
158
  @logger.catch
157
159
  def main():
158
160
  """
@@ -24,6 +24,7 @@ def normalize_path(path_str):
24
24
  """
25
25
  Normalize a path string to handle cross-platform path issues.
26
26
  Properly handles trailing slashes and backslashes in both Windows and Unix paths.
27
+ Also strips surrounding quotes that might be present in command line arguments.
27
28
 
28
29
  Args:
29
30
  path_str (str): The path string to normalize
@@ -35,6 +36,9 @@ def normalize_path(path_str):
35
36
  if isinstance(path_str, Path):
36
37
  path_str = str(path_str)
37
38
 
39
+ # Strip surrounding quotes (both single and double)
40
+ path_str = path_str.strip().strip('"').strip("'")
41
+
38
42
  # Remove trailing slashes or backslashes
39
43
  path_str = path_str.rstrip("/").rstrip("\\")
40
44
 
@@ -300,8 +304,20 @@ def get_subtitles(show_id, seasons: set[int], config=None, max_retries=3):
300
304
 
301
305
 
302
306
  def clean_text(text):
303
- # Remove brackets, parentheses, and their content
304
- cleaned_text = re.sub(r"\[.*?\]|\(.*?\)|\{.*?\}", "", text)
307
+ # Remove brackets and curly braces with their content
308
+ cleaned_text = re.sub(r"\[.*?\]|\{.*?\}", "", text)
309
+ # Remove parentheses content EXCEPT for those containing exactly 4 digits (years)
310
+ # First, temporarily replace year patterns with a placeholder
311
+ year_pattern = r"\((\d{4})\)"
312
+ years = re.findall(year_pattern, cleaned_text)
313
+ cleaned_text = re.sub(year_pattern, "YEAR_PLACEHOLDER", cleaned_text)
314
+ # Remove all remaining parentheses content
315
+ cleaned_text = re.sub(r"\([^)]*\)", "", cleaned_text)
316
+ # Restore the years
317
+ for year in years:
318
+ cleaned_text = cleaned_text.replace("YEAR_PLACEHOLDER", f"({year})", 1)
319
+ # Normalize multiple spaces to single spaces
320
+ cleaned_text = re.sub(r"\s+", " ", cleaned_text)
305
321
  # Strip leading/trailing whitespace
306
322
  return cleaned_text.strip()
307
323
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkv-episode-matcher
3
- Version: 0.9.6
3
+ Version: 0.9.8
4
4
  Summary: The MKV Episode Matcher is a tool for identifying TV series episodes from MKV files and renaming the files accordingly.
5
5
  Home-page: https://github.com/Jsakkos/mkv-episode-matcher
6
6
  Author: Jonathan Sakkos
@@ -1,15 +1,15 @@
1
1
  mkv_episode_matcher/.gitattributes,sha256=Gh2-F2vCM7SZ01pX23UT8pQcmauXWfF3gwyRSb6ZAFs,66
2
2
  mkv_episode_matcher/__init__.py,sha256=u3yZcpuK0ICeUjxYKePvW-zS61E5ss5q2AvqnSHuz9E,240
3
- mkv_episode_matcher/__main__.py,sha256=iYuO2xWt1Xf_MXxJd_XKCrEgpicawE8LlZWtIq9dk90,12380
3
+ mkv_episode_matcher/__main__.py,sha256=CLdi75NhCTNJHsyERSKLE_rj2ydSIycD-doYFmEu_X8,12382
4
4
  mkv_episode_matcher/config.py,sha256=2UUdhVZ3uMXPenPlwvpgRujointbQItrcj46GW_nnfY,2351
5
5
  mkv_episode_matcher/episode_identification.py,sha256=oKIsY8RgcbHpD0Q3rTkrds0GnLIJzrS8x8wn5zh8qYc,17101
6
6
  mkv_episode_matcher/episode_matcher.py,sha256=r6A9K4g4a8yU5aJ42n2yWuVgu5azBRE9FY3kDcdfe3w,6545
7
7
  mkv_episode_matcher/subtitle_utils.py,sha256=z4eYTMAoI8BVzdCNeqHu-9mkhwG8RzxE5BbNjWUJwCg,2552
8
8
  mkv_episode_matcher/tmdb_client.py,sha256=LbMCgjmp7sCbrQo_CDlpcnryKPz5S7inE24YY9Pyjk4,4172
9
- mkv_episode_matcher/utils.py,sha256=Q9XFA-EIbMAsUKRtK5z23G1zgJKtxTcD-TkaHQKYIK8,17956
10
- mkv_episode_matcher-0.9.6.dist-info/licenses/LICENSE,sha256=ScBvQ_sUEpaRMDYp01qmMDELT1nTknFP2w-VRAS54TY,1071
11
- mkv_episode_matcher-0.9.6.dist-info/METADATA,sha256=eY20SpnJMmOmxZbSZWwuaPsrKpjUWxwtZisSw5T680E,7664
12
- mkv_episode_matcher-0.9.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
- mkv_episode_matcher-0.9.6.dist-info/entry_points.txt,sha256=IglJ43SuCZq2eQ3shMFILCkmQASJHnDCI3ogohW2Hn4,64
14
- mkv_episode_matcher-0.9.6.dist-info/top_level.txt,sha256=XRLbd93HUaedeWLtkyTvQjFcE5QcBRYa3V-CfHrq-OI,20
15
- mkv_episode_matcher-0.9.6.dist-info/RECORD,,
9
+ mkv_episode_matcher/utils.py,sha256=4waqtptLEtW-KAlkjZaw7_K8R0N6vIIiFV1wxiQjuW4,18796
10
+ mkv_episode_matcher-0.9.8.dist-info/licenses/LICENSE,sha256=ScBvQ_sUEpaRMDYp01qmMDELT1nTknFP2w-VRAS54TY,1071
11
+ mkv_episode_matcher-0.9.8.dist-info/METADATA,sha256=o0fDQ9JjTAu4Ex28Ms8P2pS4a9EuhFzrOhHuDlKr1IA,7664
12
+ mkv_episode_matcher-0.9.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
13
+ mkv_episode_matcher-0.9.8.dist-info/entry_points.txt,sha256=IglJ43SuCZq2eQ3shMFILCkmQASJHnDCI3ogohW2Hn4,64
14
+ mkv_episode_matcher-0.9.8.dist-info/top_level.txt,sha256=XRLbd93HUaedeWLtkyTvQjFcE5QcBRYa3V-CfHrq-OI,20
15
+ mkv_episode_matcher-0.9.8.dist-info/RECORD,,