danielfernau / unifi-protect-video-downloader

Tool for downloading footage from a local UniFi Protect system
https://ui-protect-dl-docs.danielfernau.com/
MIT License
477 stars 55 forks source link

Exclude cameras which have never recorded anything #70

Open danielfernau opened 2 years ago

danielfernau commented 2 years ago

As suggested by @adriankeenan in https://github.com/unifi-toolbox/unifi-protect-video-downloader/issues/40#issuecomment-1008444205

Skip downloads for all cameras where camera["stats"]["video"]["recordingStart"] is None (no recordings) instead of int (timestamp of first available recording).

Currently, the software will try to download recordings even if there are none, resulting in an error: TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'


Related: #40

danielfernau commented 2 years ago

Should be (partially) fixed by PR #89 -- however, I need to check if it correctly handles cameras which have never recorded anything since being added to the system. My current tests only cover cases where there are no recent recordings (or only very few motion recordings multiple days apart).