zap2it-GuideScraping icon indicating copy to clipboard operation
zap2it-GuideScraping copied to clipboard

common episode-number is incorrect

Open mcondorx opened this issue 9 months ago • 4 comments

I found a minor bug in handling the common episode-number.

The code generates: <episode-num system="common">SSH01915214E163</episode-num>

It should be: <episode-num system="common">S73E163</episode-num>

The simple change is to line #223: episodeNum = "S" + str(event["seriesId"]).zfill(2) + "E" + str(episode.zfill(2)) to episodeNum = "S" + str(season).zfill(2) + "E" + str(episode.zfill(2))

Sorry I don't know how to do the Git change updates etc. . .

  • Mark

mcondorx avatar Mar 29 '25 13:03 mcondorx

Adjusted per recommendation in latest commit: 5423ede3da83b9ff979a85cd17c04e02354e37d1

daniel-widrick avatar Apr 05 '25 14:04 daniel-widrick

Adjusted per recommendation in latest commit: 5423ede

I am now getting the correct common episode number.

With a change you made for another issue you are now letting season "0" through so I am seeing things like:

	<category>Series</category>
	<episode-num system="common">S00E109</episode-num>
	<episode-num system="xmltv_ns">.108</episode-num>
	<episode-num system="dd_progid">EP03944032.1458</episode-num>

I don't know enough to know if the S00 in S00E109 is OK or not.

Thanks,

  • Mark

mcondorx avatar Apr 05 '25 14:04 mcondorx

I went digging... https://github.com/jellyfin/Jellyfin.XmlTv/blob/77aa5427fbb8ad3aad46c812ad36531ca8ab6b9d/src/Jellyfin.XmlTv/XmlTvReader.cs#L605

So it appears that "common" isn't even recognized.

The closest system is https://github.com/jellyfin/Jellyfin.XmlTv/blob/77aa5427fbb8ad3aad46c812ad36531ca8ab6b9d/src/Jellyfin.XmlTv/XmlTvReader.cs#L637 and it appears the leading numbers WOULD be supported.

....We could duplicate the "common" element into "SxxExx"to help compaitibility outside of jellyfin's parser... but the regex->int.tryparse should handle the zero padding as expected.

daniel-widrick avatar Apr 05 '25 15:04 daniel-widrick

Adjusted per recommendation in latest commit: 5423ede

I am now getting the correct common episode number.

With a change you made for another issue you are now letting season "0" through so I am seeing things like:

	<category>Series</category>
	<episode-num system="common">S00E109</episode-num>
	<episode-num system="xmltv_ns">.108</episode-num>
	<episode-num system="dd_progid">EP03944032.1458</episode-num>

I don't know enough to know if the S00 in S00E109 is OK or not.

Thanks,

  • Mark

FWIW, I looked at an xmltv file that was produced by the zap2xml.exe program when zap2it was still alive. The author elided common epidode-num entries when there was no season/season 0.

Not definitive, but a data point.

  • Mark

mcondorx avatar Apr 05 '25 16:04 mcondorx