From 382deba302d39aa45e0dea67e0b3d86ee6f2988f Mon Sep 17 00:00:00 2001 From: Peter Bennett Date: Fri, 17 May 2024 16:28:19 -0400 Subject: [PATCH] Service API: Fix Add Record Schedulesilent failure When AddRecordSchedule had a duplicate key error on the database, it was returning normally, giving no indication that it had failed. Changed so that it returns an error code and message. --- mythtv/programs/mythbackend/servicesv2/v2dvr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mythtv/programs/mythbackend/servicesv2/v2dvr.cpp b/mythtv/programs/mythbackend/servicesv2/v2dvr.cpp index 1aba8cfb7a0..6320c99eaf6 100644 --- a/mythtv/programs/mythbackend/servicesv2/v2dvr.cpp +++ b/mythtv/programs/mythbackend/servicesv2/v2dvr.cpp @@ -1537,7 +1537,9 @@ uint V2Dvr::AddRecordSchedule ( if (!rule.IsValid(msg)) throw QString(msg); - rule.Save(); + bool success = rule.Save(); + if (!success) + throw QString("DATABASE ERROR: Check for duplicate recording rule"); uint recid = rule.m_recordID;