diff --git a/titles/chuni/read.py b/titles/chuni/read.py index db7435c..f4c75ad 100644 --- a/titles/chuni/read.py +++ b/titles/chuni/read.py @@ -117,6 +117,11 @@ class ChuniReader(BaseReader): ) async def read_events(self, evt_dir: str) -> None: + # Disable all previous announcement events + # All new announcement events will be enabled, so we don't end up with banner spam + # every time we card in. + await self.data.static.disable_all_events(self.version, 1) + for root, dirs, files in walk(evt_dir): for dir in dirs: if path.exists(f"{root}/{dir}/Event.xml"): diff --git a/titles/chuni/schema/static.py b/titles/chuni/schema/static.py index b4a7b05..70a065c 100644 --- a/titles/chuni/schema/static.py +++ b/titles/chuni/schema/static.py @@ -339,6 +339,10 @@ class ChuniStaticData(BaseData): if result is None: return None return result.fetchall() + + async def disable_all_events(self, version: int, type: int): + sql = events.update().where((events.c.version == version) & (events.c.type == type)) + await self.execute(sql) async def put_music( self, @@ -593,4 +597,4 @@ class ChuniStaticData(BaseData): result = await self.execute(sql) if result is None: return None - return result.fetchone() \ No newline at end of file + return result.fetchone()