Skip to content

Commit

Permalink
update parse_title function (#18)
Browse files Browse the repository at this point in the history
Co-authored-by: Spoked <[email protected]>
  • Loading branch information
mhdzumair and dreulavelle authored Aug 26, 2024
1 parent 0324964 commit 29deec2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PTT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
add_defaults(_parser)


def parse_title(raw_title: str, translate_langs: bool = False) -> dict:
def parse_title(raw_title: str, translate_languages: bool = False) -> dict:
"""
Parse the given input string using the initialized parser instance.
:param raw_title: The input raw torrent title to parse.
:param translate_languages: Whether to translate language codes to language names or short codes (default: False returns short codes)
:return: A dictionary with the parsed results.
"""
return _parser.parse(raw_title, translate_langs)
return _parser.parse(raw_title, translate_languages)


__all__ = ["Parser", "add_defaults", "parse", "parse_title", "handlers", "transformers"]
1 change: 1 addition & 0 deletions PTT/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ def parse(self, title: str, translate_languages: bool = False) -> Dict[str, Any]
Parse a release title and return the parsed data as a dictionary.
:param title: The release title to parse.
:param translate_languages: Whether to translate language codes to language names or short codes (default: False returns short codes)
:return: A dictionary containing the parsed data.
"""
title = regex.sub(r"_+", " ", title)
Expand Down

0 comments on commit 29deec2

Please sign in to comment.