Skip to content

Commit

Permalink
ptp - tags - normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Dec 27, 2024
1 parent 7fcbb0d commit ca370dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/trackers/PTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,17 @@ async def get_tags(self, check_against):
"history", "horror", "martial.arts", "musical", "mystery", "performance", "philosophy", "politics", "romance",
"sci.fi", "short", "silent", "sport", "thriller", "video.art", "war", "western"
]

if not isinstance(check_against, list):
check_against = [check_against]
normalized_check_against = [
x.lower().replace(' ', '').replace('-', '') for x in check_against if isinstance(x, str)
]
for each in ptp_tags:
if any(each.replace('.', '') in x for x in check_against.lower().replace(' ', '').replace('-', '')):
clean_tag = each.replace('.', '')
if any(clean_tag in item for item in normalized_check_against):
tags.append(each)

return tags

async def search_existing(self, groupID, meta, disctype):
Expand Down

0 comments on commit ca370dd

Please sign in to comment.