mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-07-11 15:31:48 +00:00
fixes bug if no flags are passed
patch bump
This commit is contained in:
parent
023fdf708b
commit
df18d9c192
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = "0.6.7"
|
__version__ = "0.6.8"
|
||||||
|
@ -25,21 +25,15 @@ def list(
|
|||||||
"""List all inputs."""
|
"""List all inputs."""
|
||||||
resp = ctx.obj['obsws'].get_input_list()
|
resp = ctx.obj['obsws'].get_input_list()
|
||||||
|
|
||||||
# For each kind flag, if it is set to True, add it to the kinds list.
|
kinds = []
|
||||||
# If no flags are set, default to all kinds.
|
if input:
|
||||||
# Define a mapping of kind names to their corresponding flags
|
kinds.append('input')
|
||||||
kind_flags = {
|
if output:
|
||||||
'input': input,
|
kinds.append('output')
|
||||||
'output': output,
|
if colour:
|
||||||
'color': colour,
|
kinds.append('colour')
|
||||||
}
|
if not any([input, output, colour]):
|
||||||
|
kinds = ['input', 'output', '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())
|
|
||||||
|
|
||||||
inputs = filter(
|
inputs = filter(
|
||||||
lambda input_: any(kind in input_.get('inputKind') for kind in kinds),
|
lambda input_: any(kind in input_.get('inputKind') for kind in kinds),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user