Skip to content

Commit

Permalink
fix tts filter
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoro committed Nov 12, 2024
1 parent f333d69 commit c1b1720
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default_install_hook_types: [pre-push]
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.2
rev: v19.1.3
hooks:
- id: clang-format
files: \.(cpp|h)$
Expand All @@ -24,7 +24,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.3
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

TP = concurrent.futures.ThreadPoolExecutor()

__version__ = "6.0.0alpha1"
__version__ = "6.0.0alpha2"
7 changes: 3 additions & 4 deletions src/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
LAST_ITEM = []
LOGGER = logging.getLogger(__name__)
_DATA_QUEUE = queue.Queue(maxsize=100)
TO_FILTER = ["Champions who earn the favor of"]


class ItemIdentifiers(enum.Enum):
Expand All @@ -31,7 +32,7 @@ def find_item(self) -> None:
while True:
data = fix_data(_DATA_QUEUE.get())
local_cache.append(data)
if not filter_data and (
if not filter_data(data) and (
any(word in data.lower() for word in ["mouse button"]) and (start := find_item_start(local_cache)) is not None
):
global LAST_ITEM
Expand Down Expand Up @@ -111,9 +112,7 @@ def find_item_start(data: list[str]) -> int | None:


def filter_data(data: str) -> True:
to_filter = ["Champions who earn the favor of"]

return any(word in data for word in to_filter)
return any(word in data for word in TO_FILTER)


def fix_data(data: str) -> str:
Expand Down

0 comments on commit c1b1720

Please sign in to comment.