Read the declared numbering system
An episode-num value needs its system attribute. The official XMLTV DTD documents xmltv_ns as a structured, zero-based numbering scheme. It is not interchangeable with a human-facing label or an arbitrary catalogue identifier.
In an invented value 2.4., the known indices correspond to season three and episode five. The missing final component remains unknown. It does not prove that the episode has no parts or that a part number should be displayed as one.
Keep the raw and displayed values
Store the source value, system and parsed components before creating a label. This makes it possible to inspect a surprising display without reconstructing the import. Apply the index conversion only to the fields that use that scheme.
A denominator expresses a count where provided; do not increment it as though it were another index. Missing components also require a deliberate parser. A general integer conversion that turns empty text into zero invents metadata.
Do not merge different systems by appearance
An onscreen label may contain wording or numbering chosen by the programme maker. Preserve that label's declared meaning rather than forcing every source into a season-and-episode pattern. A catalogue ID that happens to contain digits is not necessarily an episode number.
Check the complete path from raw import through display and search index. A correct database field can still be transformed twice by a later formatter. This is a hypothetical importer example, with no assertion about the order or episode count of a real series.
Questions answered
Does xmltv_ns 2.4. mean season two, episode four?
No. Its zero-based known indices correspond to season three, episode five.
Should an empty component become zero automatically?
No. Preserve unknown information rather than manufacturing a first part or episode.
Sources & further reading
Official references for the subjects discussed. Service terms and device software can change.

