Skip to content

Commit

Permalink
Fix sending message for already open betas
Browse files Browse the repository at this point in the history
This fixes the script not sending a message when a beta is already
open on startup.
  • Loading branch information
samuelgrf committed Jan 6, 2024
1 parent 24dc055 commit 7ac36c7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions testflight_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ def watch(watch_ids, callback, notify_full=True, sleep_time=900):
headers={"Accept-Language": "en-us"})
page = html.fromstring(req.text)
free_slots = page.xpath(XPATH_STATUS)[0] not in FULL_TEXTS
if tf_id not in data:

if (tf_id not in data or data[tf_id] != free_slots):
if free_slots or notify_full:
title = re.findall(
TITLE_REGEX,
page.xpath(XPATH_TITLE)[0])[0]
callback(tf_id, free_slots, title)
data[tf_id] = free_slots
else:
if data[tf_id] != free_slots:
if free_slots or notify_full:
title = re.findall(
TITLE_REGEX,
page.xpath(XPATH_TITLE)[0])[0]
callback(tf_id, free_slots, title)
data[tf_id] = free_slots
sleep(sleep_time)

0 comments on commit 7ac36c7

Please sign in to comment.