[mythtv] Services bug with dupin field
pb.mythtv at gmail.com
Fri Aug 21 18:48:27 UTC 2020
The dupin (Dup Scope) field in the record table is used for telling
whether to check for duplicates in Recorded, Oldrecorded, or both. It is
also used to indicate whether to record only "new episodes" or "new and
repeat episodes". The value for "new episodes" is 0x10 and that is
"ored" with the other duplicate settings (0x01, 0x02, 0x0f). The
toRawString and other similar functions in recordingtypes.cpp assign the
value "New Episodes Only" to the value 16 but that is never found, as
the 0x10 flag is always set in conjunction with other values, so if you
have "Record New Episodes Only" selected, the services apis
GetRecordSchedule and GetRecordScheduleList return "Unknown" for Dupin.
I propose changing the toRawString and similar routines to return the
value "New Episodes Only" when the 0x10 bit is set, regardless of other
values, since checking for duplicates is moot if you are recording new
episodes only, and "Unknown" is not helpful.
In the case of the "AddRecordSchedule" method, setting "New Episodes
Only" will currently set a value of 0x10. This is invalid since creation
of record rules through the frontend never results in this value. In the
frontend you always have to also set where to check duplicates, you
cannot set it to check duplicates in neither recorded nor oldrecorded
(even if you selected "Dont Match Duplicates" in the dup method)
I propose changing dupInFromString so that if you set "new episodes
only" it combines that with "all recordings". Otherwise if you create a
record rule through the api using "new episodes only" and subsequently
edit it through the frontend to take off "new episodes only" you may be
left with a rule having an invalid dupin of zero.
Any comments or suggestions? Let me know.
The frontend is a bit inconsistent - if you select "don't match
duplicates" it prevents you from changing "dup scope" but if you
selected "new episodes only" you can still select duplicate checking
methods and scope.
More information about the mythtv-dev