fix: wipe cache when removing row

This commit is contained in:
aclist committed 2026-04-25 19:17:32 +09:00
1 parent ed508c6764
commit 61735d20cf
6 files changed
+20 -13

No files matched your search

+2
View File
@@ -51,6 +51,7 @@ class ProxyModelManager:
for record in self.control_model:
if row[7] == record[7] and row[8] == record[8]:
self.control_model.remove(record)
self.wipe_cache()
self.filter(FilterMode.INITIAL, skip_cache=True)
def update_playercount(self, playercount: "NewPlayerCount") -> None:
@@ -214,6 +215,7 @@ class ProxyModelManager:
) -> None:
self.filter_cache[filters] = (model, rows)
@deprecated("legacy logic")
def resync_model(self, addr: str, qport: int) -> None:
"""
Handle in-situ updates to model during
+1 -7
View File
@@ -54,15 +54,9 @@ class ServerModelManager:
self.preserve_on_fail = False
self.jobs = 1
# NOTE: store filter man for access inside thread
self.proxy_man = tv.get_proxy_man()
self.thread_man = ThreadingManager(self.controller)
# TODO: if first iteration, clear filter man control model
# literal first load: iteration 1
# refresh: should be functionally identical to iteration 1
# filter: iteration N+1
def load(self) -> None:
"""
There may be cases where you want to instantiate this class without dumping servers,
@@ -327,8 +321,8 @@ class ServerModelManager:
maps = self._get_new_maps()
filter_man.set_unique_maps(maps)
self.emitter.emit("servers_loaded_init")
self.first_iteration = False
self.emitter.emit("servers_loaded_init")
self.emitter.emit("saved_servers_changed")
def _update_maps(self) -> None: