From df18d9c1928ef4ff32c4fe76df5a0fb690aa44d4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 22 Apr 2025 00:26:32 +0100 Subject: [PATCH] fixes bug if no flags are passed patch bump --- obsws_cli/__about__.py | 2 +- obsws_cli/input.py | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/obsws_cli/__about__.py b/obsws_cli/__about__.py index 0bb7925..f2aa0d5 100644 --- a/obsws_cli/__about__.py +++ b/obsws_cli/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2025-present onyx-and-iris # # SPDX-License-Identifier: MIT -__version__ = "0.6.7" +__version__ = "0.6.8" diff --git a/obsws_cli/input.py b/obsws_cli/input.py index e717074..481bc20 100644 --- a/obsws_cli/input.py +++ b/obsws_cli/input.py @@ -25,21 +25,15 @@ def list( """List all inputs.""" resp = ctx.obj['obsws'].get_input_list() - # For each kind flag, if it is set to True, add it to the kinds list. - # If no flags are set, default to all kinds. - # Define a mapping of kind names to their corresponding flags - kind_flags = { - 'input': input, - 'output': output, - 'color': colour, - } - - # Collect all kinds where the corresponding flag is set to True - kinds = [kind for kind, flag in kind_flags.items() if flag] - - # If no flags are set, default to all kinds - if not kinds: - kinds = list(kind_flags.keys()) + kinds = [] + if input: + kinds.append('input') + if output: + kinds.append('output') + if colour: + kinds.append('colour') + if not any([input, output, colour]): + kinds = ['input', 'output', 'colour'] inputs = filter( lambda input_: any(kind in input_.get('inputKind') for kind in kinds),