Skip to content

Commit

Permalink
Bump version v0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Fazzani committed Dec 24, 2024
1 parent 5ec96f8 commit 157012c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pliptv/pl_filters/clean_name_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from pliptv.pl_filters.filter_abc import FilterABC, LoggingFilterAbcMixin
from pliptv.utils.log.decorators import func_logger

regex_white_spaces = re.compile(r"(\s)+")


class CleanNameFilter(FilterABC, metaclass=LoggingFilterAbcMixin):
def __init__(self, config: PlaylistConfig):
Expand All @@ -17,6 +19,9 @@ def apply(self, value: Stream) -> Stream:
for reg in self.filter_config.regex:
regex = re.compile(reg, re.I | re.DOTALL)
value.meta.display_name = regex.sub("", value.meta.display_name).strip()

for replacement in self.filter_config.replacements:
value.meta.display_name = value.meta.display_name.replace(replacement, "")

value.meta.display_name = regex_white_spaces.sub(" ", value.meta.display_name)
return value

0 comments on commit 157012c

Please sign in to comment.