Recording rule filter question plus answer

Post Reply
Posts: 26
Joined: Tue Nov 10, 2015 9:36 am
Location: Amsterdam-area, NL

Recording rule filter question plus answer

Post by fransgl » Tue May 21, 2019 12:36 pm


I was going to ask a question about recording rule filters like 'this channel', 'this time', 'this series', etc. However, in the meantime I found the answer, but still decided to post, because it is not very obvious and it may be useful to others.
See this page for context about the services involved: ... rdSchedule

All filters are stored in an Int-field in a bitwise manner. For instance, bit 8 (=256) is for 'this time', bit 10 (1024) is for 'this channel'. Once that was clear, it was a matter of implementing that in Swift and I found along the way that Swift has very good facilities for this using the OptionSet-protocol.

For reference, this is the complete list of recording rule filters that I found in the C++ source:

Code: Select all

// Define the strings inserted into the recordfilter table in the
// database.  This should make them available to the translators.
static QString fs0(QT_TRANSLATE_NOOP("SchedFilterEditor", "New episode"));
static QString fs1(QT_TRANSLATE_NOOP("SchedFilterEditor", "Identifiable episode"));
static QString fs2(QT_TRANSLATE_NOOP("SchedFilterEditor", "First showing"));
static QString fs3(QT_TRANSLATE_NOOP("SchedFilterEditor", "Prime time"));
static QString fs4(QT_TRANSLATE_NOOP("SchedFilterEditor", "Commercial free"));
static QString fs5(QT_TRANSLATE_NOOP("SchedFilterEditor", "High definition"));
static QString fs6(QT_TRANSLATE_NOOP("SchedFilterEditor", "This episode"));
static QString fs7(QT_TRANSLATE_NOOP("SchedFilterEditor", "This series"));
static QString fs8(QT_TRANSLATE_NOOP("SchedFilterEditor", "This time"));
static QString fs9(QT_TRANSLATE_NOOP("SchedFilterEditor", "This day and time"));
static QString fs10(QT_TRANSLATE_NOOP("SchedFilterEditor", "This channel"));
static QString fs11(QT_TRANSLATE_NOOP("SchedFilterEditor", "No episodes"));
I will now proceed to finalise an update release of the Glorious MythTV-app and submit that to the AppStore.

Best regards, Frans

Post Reply