[mythtv] SpecialRecordingGroups hard coded IDs

mythtv mythtv at mdabbs.org
Fri May 3 17:48:57 UTC 2019


On 5/2/19 11:02 AM, mythtv wrote:
> On 5/2/19 9:46 AM, mythtv wrote:
>> On 5/2/19 9:13 AM, Stuart Auchterlonie wrote:
>>>
>>> We already have the function GetRecgroupId, see [1]. Does that not do
>>> what you were thinking of?
>>>
>>> [1] -
>>> https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythtv/recordinginfo.cpp#L1603-L1617 
>>>
>>>
>> That would work too, although I wanted to avoid using the String 
>> versions of the special groups because I thought I saw somewhere in 
>> the code that the String versions were trying to be phased out. So 
>> having the separate methods would avoid still using the string names 
>> outside of the recordinginfo class.
>>
>> I'm okay either way though. I'll defer to the wisdom of the existing 
>> dev team. If everyone has an aversion to more methods in the class, I 
>> could just call GetRecgoupId and pass the names in.
>> _______________________________________________
>> mythtv-dev mailing list
>> mythtv-dev at mythtv.org
>> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
>> http://wiki.mythtv.org/Mailing_List_etiquette
>> MythTV Forums: https://forum.mythtv.org
> 
> Or, maybe better yet, just one method to convert the 
> SpecialRecordingGroup enum to the actual ID, instead of assuming the 
> SpecialRecordingGroup *IS* the ID.  So something like:
> 
> uint RecordingInfo::GetSpecialRecgroupID(SpecialRecordingGroups group)
> {
>      QString names[3] = { QString("Default"), QString("LiveTV"), 
> QString("Deleted") };
> 
>      return GetRecgroupID(names[group]);
> }
> 
> And renumbering the enum to start at 0:
> 
> typedef enum {
>      kDefaultRecGroup     = 0,
>      kLiveTVRecGroup      = 1,
>      kDeletedRecGroup     = 2,
> } SpecialRecordingGroups;
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

And here's a patch for consideration... (It's against fixes/29, sorry)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythtv-recording-groups.patch
Type: text/x-patch
Size: 5450 bytes
Desc: not available
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20190503/dbf22e40/attachment.bin>


More information about the mythtv-dev mailing list