Page 1 of 1

ZoneMinder::Control::Reolink refactoring

Posted: Sat Feb 20, 2021 1:18 pm
by The Eye
I took the liberty of a first stab at the source - see attachment.

It shall be deemed work-in-progress because it is neither finished, nor sufficiently tested (beyond a perl -c) yet.
It seems, that compared with the other Control modules the Reolink code is at technical debt level 9000. :wink:

For now removed like 50% of the code, which was just brutal copy&paste boilerplate and suddenly the
code starts revealing what it aims to do. My guess is that the 39000 bytes can be cut to 10000 and
hopefully I will eventually make the Reolink module the shiniest one. 8)

Will need more quality time with the code still, so JFYI that something like that is happening.

PS: "Invalid file extension for .pm files..." :roll: - so .txt it is.

Re: ZoneMinder::Control::Reolink refactoring

Posted: Sat Feb 20, 2021 8:36 pm
by The Eye
Next iteration.

I shall - however - deep dive into ZoneMinder::ONVIF and therefore the ONVIF::Client rabbit hole. Maybe even most of this code will not be necessary anymore.

Reolink claims their cams do support ONVIF 2.1 and I would think the right way to do things would be some nice GetCapabilities voodoo before doing something with the camera (according to what the camera claims it is capable to do). And then I suppose it wouldn't even need a Reolink-specific code.

Re: ZoneMinder::Control::Reolink refactoring

Posted: Sun Feb 21, 2021 8:48 pm
by jperkins
I'd hate to see your work go to waste. When I submitted a very small pull request it was applied quickly. Please note I did not read your changes but based on your comment maybe you would want to start with something smaller at first. Of course if you just wanna modify your own copy of Zoneminder, have at it. I'm fairly certain posting changes like this will never improve zoneminder . Hope this helps

https://github.com/ZoneMinder/zoneminde ... l-Requests

Re: ZoneMinder::Control::Reolink refactoring

Posted: Mon Feb 22, 2021 8:32 am
by The Eye
jperkins wrote:
Sun Feb 21, 2021 8:48 pm
Please note I did not read your changes but based on your comment maybe you would want to start with something smaller at first.
Not sure what you mean by smaller. This thread isn't meant as a side-channel for patch submission, it's a JFYI.
I'm very well aware of the standard GitHub PR process.

Re: ZoneMinder::Control::Reolink refactoring

Posted: Mon Feb 22, 2021 7:08 pm
by iconnor
Thanks for taking this on.