Don't use set

This commit is contained in:
Nick Mowen 2022-09-26 07:27:21 -06:00
parent e200718046
commit 412144bed6

View File

@ -85,18 +85,13 @@ def get_temperatures() -> dict[str, float]:
def get_gpu_stats(config: FrigateConfig) -> dict[str, dict]:
"""Parse GPUs from hwaccel args and use for stats."""
hwaccel_args = set(
map(
lambda camera: camera.ffmpeg.hwaccel_args
if camera.ffmpeg.hwaccel_args
else None,
config.cameras.values(),
)
)
stats: dict[str, dict] = {}
hwaccel_args = []
if None in hwaccel_args:
hwaccel_args.remove(None)
for camera in config.cameras.values():
if hwaccel_args and camera.ffmpeg.hwaccel_args not in hwaccel_args:
hwaccel_args.append(camera.ffmpeg.hwaccel_args)
stats: dict[str, dict] = {}
if not hwaccel_args:
return None