Skip to content

Commit

Permalink
Service API: Fix Add Record Schedulesilent failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bennettpeter committed May 17, 2024
1 parent 60bea43 commit 382deba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mythtv/programs/mythbackend/servicesv2/v2dvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 382deba

Please sign in to comment.