Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

Discord digest: prereleases are not announced as out (the app's updater skips them too) (#128)

Mikek4078e5523222
diff --git a/scripts/discord-digest.py b/scripts/discord-digest.py
index f52718da296..4e81d36a696 100644
--- a/scripts/discord-digest.py
+++ b/scripts/discord-digest.py
@@ -43,7 +43,7 @@ def when(text):
def recent_releases(hours, now=None, releases=None):
now = now or datetime.now(timezone.utc)
releases = github("/releases?per_page=40") if releases is None else releases
- found = [r for r in releases if APP_TAG.match(r.get("tag_name", "")) and not r.get("draft")
+ found = [r for r in releases if APP_TAG.match(r.get("tag_name", "")) and not r.get("draft") and not r.get("prerelease")
and r.get("published_at") and now - when(r["published_at"]) <= timedelta(hours=hours)]
return sorted(found, key=lambda r: when(r["published_at"]))
diff --git a/tests/test_discord_digest.py b/tests/test_discord_digest.py
index 47fa583917d..3996385156c 100644
--- a/tests/test_discord_digest.py
+++ b/tests/test_discord_digest.py
@@ -20,6 +20,8 @@ class DigestTests(unittest.TestCase):
release("v1.14.16", "2026-11-12T19:11:00Z"), release("v1.14.13", "2026-11-12T07:53:00Z"),
release("steam-support-v4", "2026-11-12T10:00:00Z"), release("v1.14.8", "2026-11-11T05:00:00Z")])
self.assertEqual([r["tag_name"] for r in found], ["v1.14.13", "v1.14.16"])
+ early = dict(release("v1.15.0", "2026-11-12T19:30:00Z"), prerelease=True)
+ self.assertEqual(d.recent_releases(24, NOW, [early]), [])
def test_release_message_has_the_notes_and_no_checksums(self):
text = d.releases_message([release("v1.14.15", "2026-11-12T16:00:00Z", "- Older change."),