@danhachuel/thunderbolt 0.3.85 → 0.3.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -317,5 +317,8 @@ def media_cards_for_pool(settings: Mapping[str, Any], pool: str) -> list[dict[st
|
|
|
317
317
|
active_key = MEDIA_IMAGE_ACTIVE_CARD_KEY if pool == "image" else MEDIA_VIDEO_ACTIVE_CARD_KEY if pool == "video" else ""
|
|
318
318
|
active_id = str(migrated.get(active_key) or "")
|
|
319
319
|
cards = [dict(item) for item in migrated.get(MEDIA_CARDS_KEY, []) if item.get("enabled", True) and item.get(capability)]
|
|
320
|
-
|
|
320
|
+
# A prioridade é o contrato principal do failover. O cartão activo legado
|
|
321
|
+
# só serve de desempate entre cartões com a mesma prioridade, para não
|
|
322
|
+
# ignorar uma escolha explícita do utilizador por causa de estado antigo.
|
|
323
|
+
cards.sort(key=lambda card: (int(card.get("priority", 0)), 0 if str(card.get("id")) == active_id else 1))
|
|
321
324
|
return cards
|
package/package.json
CHANGED