I noticed an anomaly when I'm importing m3u files ? The initial first m3u file loads fine and channel.number = channel_mapping.channel_source_number where channel.oid = channel_mapping.channel_source_oid. But any subsequent m3u file I import ends up with the new channels having channel_source_number being 1 more than it should be. For example if the 2nd file started channel numbering at 300, then the first new row added would have channel.number = 300 but the matching channel_source_oid in channel_mapping would have channel_source_number = 301 and that pattern continues for all the newly added rows in the 2nd m3u file.
I presume NextPVR joins using the oid's so maybe this issue was never noticed before. I noticed because I have some scripts that I use for reassigning tuning and epg columns and find it convenient to be able to query channel_mapping by channel_source_number. I thought I was doing something wrong until I noticed that the channel numbers weren't aligning properly on the newly added rows. So every time I import another m3u file, I end up running a script to correct the channel matching between channel & channel_mapping tables.
Both tables always have the same number of rows and as mentioined, the very first file always loads correctly. Its the 2nd, 3rd, 4th, etc files that seem to hit this issue.
I get that in a purely "normalized" database, channel_source_number wouldn't even be there and that its likely there just for convenience, but in order to take advantage of this convenience, I need to correct it after each new m3u load.
I presume NextPVR joins using the oid's so maybe this issue was never noticed before. I noticed because I have some scripts that I use for reassigning tuning and epg columns and find it convenient to be able to query channel_mapping by channel_source_number. I thought I was doing something wrong until I noticed that the channel numbers weren't aligning properly on the newly added rows. So every time I import another m3u file, I end up running a script to correct the channel matching between channel & channel_mapping tables.
Both tables always have the same number of rows and as mentioined, the very first file always loads correctly. Its the 2nd, 3rd, 4th, etc files that seem to hit this issue.
I get that in a purely "normalized" database, channel_source_number wouldn't even be there and that its likely there just for convenience, but in order to take advantage of this convenience, I need to correct it after each new m3u load.