From 1461e738ac1be9c27faa4762ab9b3215a45366fb Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 13 Dec 2023 14:44:23 -0700 Subject: [PATCH] eibkolibri: Follow channel update with channel import If new nodes are added in a new channel version, the channel needs to be updated or they will be skipped if they're below an already existing node. However, if there are missing nodes from a previously failed import, then a regular import is needed. Therefore, follow a channel update with a channel import. The update is run first because the algorithm for calculating newly needed nodes depends on comparing the old and new versions of the channel metadata. One a regular import is done, the old version of the channel metadata is replaced and the calculation can't be made anymore. https://phabricator.endlessm.com/T34697 --- lib/eibkolibri.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/eibkolibri.py b/lib/eibkolibri.py index e9a2f440..36b1b2b7 100755 --- a/lib/eibkolibri.py +++ b/lib/eibkolibri.py @@ -190,12 +190,13 @@ def seed_channel(self, channel_id): """Import or update channel and content on remote Kolibri server If the channel exists, it will be updated since Kolibri won't - import new content nodes otherwise. + import new content nodes otherwise. An import is always run to + ensure any nodes missed because of a previous failure are + imported. """ if self._channel_exists(channel_id): self.update_channel(channel_id) - else: - self.import_channel(channel_id) + self.import_channel(channel_id) def _get_server_series(self): """Determine the server Kolibri series"""