mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-05-15 22:10:23 +01: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-License-Identifier: MIT
|
||||
__version__ = "0.6.7"
|
||||
__version__ = "0.6.8"
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user