Skip to content

Commit bd6c6dd

Browse files
committed
address review
1 parent 5ee8d92 commit bd6c6dd

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -893,17 +893,7 @@ add_subdirectory(onvif)
893893

894894
if(BUILD_TEST_SUITE)
895895
message("Building unit tests: Yes")
896-
find_package(Catch2 QUIET)
897-
if(NOT Catch2_FOUND)
898-
message(STATUS "Catch2 not found via find_package; fetching it with FetchContent")
899-
include(FetchContent)
900-
FetchContent_Declare(
901-
Catch2
902-
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
903-
GIT_TAG v3.7.1
904-
)
905-
FetchContent_MakeAvailable(Catch2)
906-
endif()
896+
find_package(Catch2 REQUIRED)
907897

908898
include(CTest)
909899
add_subdirectory(tests)

src/zm_monitor_go2rtc.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ int Monitor::Go2RTCManager::add_to_Go2RTC() {
223223
const std::string &primary_path = Use_RTSP_Restream ? rtsp_restream_path : rtsp_path;
224224
const std::string id_str = std::to_string(parent->Id());
225225
const std::string monitor_name = parent->Name();
226+
const bool has_monitor_name = !monitor_name.empty() && monitor_name != id_str;
226227

227228
const auto add_stream = [&](const std::string &stream_name,
228229
const std::string &display_name,
@@ -248,14 +249,14 @@ int Monitor::Go2RTCManager::add_to_Go2RTC() {
248249
curl_easy_cleanup(curl);
249250
return -1;
250251
}
251-
if (monitor_name != id_str) {
252+
if (has_monitor_name) {
252253
add_stream(monitor_name, monitor_name, primary_path, "primary (monitor name)");
253254
}
254255

255256
// Add ZoneMinder restream paths (when RTSP restreamer is enabled)
256257
if (Use_RTSP_Restream) {
257258
if (add_stream(id_str + "_ZoneMinderPrimary", monitor_name + " ZoneMinder Primary",
258-
rtsp_restream_path, "ZoneMinderPrimary (monitor ID)") && monitor_name != id_str) {
259+
rtsp_restream_path, "ZoneMinderPrimary (monitor ID)") && has_monitor_name) {
259260
add_stream(monitor_name + "_ZoneMinderPrimary", monitor_name + " ZoneMinder Primary",
260261
rtsp_restream_path, "ZoneMinderPrimary (monitor name)");
261262
}
@@ -264,15 +265,15 @@ int Monitor::Go2RTCManager::add_to_Go2RTC() {
264265
// Add direct camera paths
265266
if (!rtsp_path.empty()) {
266267
if (add_stream(id_str + "_CameraDirectPrimary", monitor_name + " Camera Direct Primary",
267-
rtsp_path, "CameraDirectPrimary (monitor ID)") && monitor_name != id_str) {
268+
rtsp_path, "CameraDirectPrimary (monitor ID)") && has_monitor_name) {
268269
add_stream(monitor_name + "_CameraDirectPrimary", monitor_name + " Camera Direct Primary",
269270
rtsp_path, "CameraDirectPrimary (monitor name)");
270271
}
271272
}
272273

273274
if (!rtsp_second_path.empty()) {
274275
if (add_stream(id_str + "_CameraDirectSecondary", monitor_name + " Camera Direct Secondary",
275-
rtsp_second_path, "CameraDirectSecondary (monitor ID)") && monitor_name != id_str) {
276+
rtsp_second_path, "CameraDirectSecondary (monitor ID)") && has_monitor_name) {
276277
add_stream(monitor_name + "_CameraDirectSecondary", monitor_name + " Camera Direct Secondary",
277278
rtsp_second_path, "CameraDirectSecondary (monitor name)");
278279
}

0 commit comments

Comments
 (0)