github PiratesIRC/Dispatcharr-Event-Channel-Managarr-Plugin v1.26.2451734
v1.26.2451734 - a dummy EPG source per channel group

5 hours ago

A dummy EPG source per channel group

Until now every channel this plugin managed shared one dummy EPG source, so they all
shared one timezone, one event duration and one set of title patterns. That breaks down
when groups differ: one provider labels its times in Eastern and another in Central,
college football wants a four hour event and volleyball wants two, and one group's titles
carry a suffix the others do not.

Per-Group EPG Sources is a new setting. Write one mapping per line:

NFL Sunday Ticket = ECM - NFL
NCAAF = ECM - NCAAF
SEC+/ACC Extra = ECM - SEC ACC

The plugin creates each listed source, seeds it from your existing settings, and then
never writes to it again. Its timezone, duration, patterns, templates, categories and
artwork are yours to edit in Dispatcharr's own EPG source editor. The shared source keeps
being maintained by the plugin as before.

A group you do not list keeps the shared source, so leaving the setting blank changes
nothing
and no existing installation is affected.

Turning it on

Fill in the setting, make sure Manage Dummy EPG is on, and make sure each mapped group
is in scan scope, meaning it appears in Channel Groups or that field is blank. Then
press Validate Configuration, which both checks the mapping and saves it so an
unattended scheduled run will use it.

Undoing a mapping

Remove the line and run an applied run. Those channels return to the shared source.

Three limits, each deliberate:

  • The plugin only takes a channel back off a source it created itself. A channel you
    put on your own dummy source is never moved back. This plugin does not rearrange sources
    it does not own.
  • A channel taken from the timezone-specific source does not automatically return there.
    It goes back to the shared source unless its name still matches that source's own pattern.
  • If the mapping has any error in it, no channel is moved back at all that run. A
    missing equals sign looks identical to "this group is no longer mapped", so rather than
    risk moving a whole group because of a typo, the plugin does nothing in that direction
    and says so.

Six behaviours worth knowing before you report a bug

  1. Routing does nothing unless Manage Dummy EPG is on.
  2. A mapped group missing from Channel Groups is never scanned, so it creates a source
    and moves nothing. Validate Configuration reports this specifically.
  3. Only channels that end a scan visible are moved.
  4. Changes reach an unattended scheduled run only after an action button saves them.
  5. An M3U refresh can trigger an applied run, so moves can happen unattended.
  6. Clearing the setting may not appear to work, because Dispatcharr does not reliably send
    a field you have emptied and the plugin keeps its saved value rather than guessing.
    Validate Configuration prints the mapping actually in use.

Nothing in this plugin deletes an EPG source, so a source created from a typo is permanent
until you remove it yourself. The user guide explains how to do that safely.

Also in this release

A new CSV column, epg_source, naming the EPG source each channel is bound to. The
export could previously show that a channel had a guide but not which source served it,
which is the one thing you need when a mapping moved something unexpectedly.

Validate Configuration now checks the mapping: lines it could not read, groups matching
no channel group, groups outside your scan scope, and a source name that clashes with a
non-dummy source. Each of those is a way a mapping can look configured and do nothing.

For anyone reading the code

The design was reviewed before implementation and rewritten once. The plan document in
docs/superpowers/plans/ records the defects found in the first version, including the one
that mattered most: the marker identifying a plugin-created source had been kept in the
source's own stored properties, and Dispatcharr's editor rebuilds that object from a fixed
key list, so saving the source would have deleted it. That record now lives in a file under
/data/.

The routing decision is a pure function covered by unit tests, with the plugin holding only
the wiring, because the plugin file cannot be imported outside the container and a test that
reads its source text cannot tell a correct comparison from an inverted one.

Don't miss a new Dispatcharr-Event-Channel-Managarr-Plugin release

NewReleases is sending notifications on new releases.