]> git.parisson.com Git - teleforma.git/commitdiff
Fix preview image url for bbb
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 7 Jul 2026 12:35:10 +0000 (14:35 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 7 Jul 2026 12:35:10 +0000 (14:35 +0200)
teleforma/webclass/models.py

index c68a34698c7a05c1e94c081f2dae2a500ebb0339..5a3c128db216f5bb7d2ce7725b87514be5de61a7 100644 (file)
@@ -77,7 +77,14 @@ def get_records_from_bbb(**kwargs):
             preview = ""
             images = format.get('preview', {}).get('images', {})
             if images:
-                preview = images.dict()['images']['image'][0].replace("http://", "https://")
+                image = images.dict()['images']['image']
+                # BBB returns a list of <image> when there are several previews,
+                # but a single string node when there is only one. Indexing [0]
+                # on that string used to grab its first char ("h"), producing a
+                # broken relative url('h') in the template.
+                if isinstance(image, list):
+                    image = image[0]
+                preview = str(image).replace("http://", "https://")
             data = {
                 'id': str(recording['recordID']),
                 'server_id': server.id,