mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-08-19 18:42:26 +02:00
fix: fix json migration UI and tests (#1484)
* fix: fix json migration UI and tests * fix: just replace the Qt stuff with the actual iterator, please * fix: skip UI iterator logic and just run iterator in migration modal * fix: remove unnecessary for loop in test
This commit is contained in:
committed by
GitHub
parent
7e7def5a52
commit
12fd4933be
@@ -361,20 +361,16 @@ class JsonMigrationModal(QObject):
|
||||
|
||||
try:
|
||||
iterator = FunctionIterator(self.migration_iterator)
|
||||
iterator.value.connect(
|
||||
lambda x: (
|
||||
pb.setLabelText(header(x, 4)),
|
||||
self.update_sql_value_ui(show_msg_box=False)
|
||||
if x == Translations["json_migration.checking_for_parity"]
|
||||
else (),
|
||||
self.update_parity_ui()
|
||||
if x == Translations["json_migration.checking_for_parity"]
|
||||
else (),
|
||||
)
|
||||
)
|
||||
|
||||
if skip_ui:
|
||||
iterator.run()
|
||||
return
|
||||
|
||||
iterator.value.connect(lambda x: pb.setLabelText(header(x, 4)))
|
||||
r = CustomRunnable(iterator.run)
|
||||
r.done.connect(
|
||||
lambda: (
|
||||
self.update_parity_ui(),
|
||||
self.update_sql_value_ui(show_msg_box=not skip_ui),
|
||||
pb.setMinimum(1),
|
||||
pb.setValue(1),
|
||||
@@ -423,7 +419,6 @@ class JsonMigrationModal(QObject):
|
||||
yield Translations["json_migration.migration_complete"]
|
||||
else:
|
||||
yield Translations["json_migration.migration_complete_with_discrepancies"]
|
||||
self.update_parity_ui()
|
||||
QApplication.beep()
|
||||
QApplication.alert(self.paged_panel)
|
||||
self.done = True
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
|
||||
from pathlib import Path
|
||||
from time import time
|
||||
|
||||
from tagstudio.qt.mixed.migration_modal import JsonMigrationModal
|
||||
|
||||
@@ -14,10 +13,6 @@ def test_json_migration():
|
||||
modal = JsonMigrationModal(CWD.parent / "fixtures" / "json_library")
|
||||
modal.migrate(skip_ui=True)
|
||||
|
||||
start = time()
|
||||
while not modal.done and (time() - start < 60):
|
||||
pass
|
||||
|
||||
# Entries ==================================================================
|
||||
# Count
|
||||
assert len(modal.json_lib.entries) == modal.sql_lib.entries_count
|
||||
|
||||
Reference in New Issue
Block a user