From 51b936ee6703f294f305cc0caba93cde72a3cd31 Mon Sep 17 00:00:00 2001 From: Wolfgang Fahl Date: Mon, 15 Jul 2024 10:00:57 +0200 Subject: [PATCH] fixes sorting and prepares release --- ceurws/__init__.py | 2 +- ceurws/volume_view.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ceurws/__init__.py b/ceurws/__init__.py index 3d26edf..df12433 100644 --- a/ceurws/__init__.py +++ b/ceurws/__init__.py @@ -1 +1 @@ -__version__ = "0.4.1" +__version__ = "0.4.2" diff --git a/ceurws/volume_view.py b/ceurws/volume_view.py index 5255a92..72df560 100644 --- a/ceurws/volume_view.py +++ b/ceurws/volume_view.py @@ -283,7 +283,9 @@ def updateWikidataVolumes(self,selected_rows): try: msg = f"{len(selected_rows)} Volumes selected
" self.clear_msg(msg) - for row in selected_rows: + # First, sort selected_rows by the volume number in ascending order + sorted_rows = sorted(selected_rows, key=lambda row: row["#"]) + for row in sorted_rows: vol_number = row["#"] volume = self.wdSync.volumesByNumber[vol_number] self.add_or_update_volume_in_wikidata(volume)