From b6b2cae53513a1c67444ef2406ae3231725571eb Mon Sep 17 00:00:00 2001 From: otrok7 <50595291+otrok7@users.noreply.github.com> Date: Sun, 10 Dec 2023 11:47:32 +0100 Subject: [PATCH] fix for tomato formats --- croutonjs/src/js/crouton-core.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js index ab5a421..fff0adb 100644 --- a/croutonjs/src/js/crouton-core.js +++ b/croutonjs/src/js/crouton-core.js @@ -651,16 +651,17 @@ function Crouton(config) { var formats = meetingData[m]['formats'].split(","); var formats_expanded = []; + let formatRootServer = self.formatsData.filter((f)=>f['root_server_id'] == meetingData[m]['root_server_id']); for (var f = 0; f < formats.length; f++) { - for (var g = 0; g < self.formatsData.length; g++) { - if (formats[f] === self.formatsData[g]['key_string']) { + for (var g = 0; g < formatRootServer.length; g++) { + if (formats[f] === formatRootServer[g]['key_string']) { formats_expanded.push( { - "id": self.formatsData[g]['id'], + "id": formatRootServer[g]['id'], "key": formats[f], - "name": self.formatsData[g]['name_string'], - "description": self.formatsData[g]['description_string'], - "type": self.formatsData[g]['format_type_enum'], + "name": formatRootServer[g]['name_string'], + "description": formatRootServer[g]['description_string'], + "type": formatRootServer[g]['format_type_enum'], } ) }