edit4ever / script.module.zap2epg

zap2epg - EPG grabber for USA/Canada
GNU General Public License v3.0
41 stars 25 forks source link

Problem with initital Zap2epg configuration and episode titles in recorded files #50

Open oldfish327 opened 2 years ago

oldfish327 commented 2 years ago

System: Ubuntu Mate 20.04, Kodi Matrix 19.3, TVHeadend 4.3-1964, User account (not run as admin)

First, thank you for writing this addon. Great stuff.

There is an issue with the defaults that are set up when you install zap2epg. The default zipcode is probably yours, and could not be changed and TV channels could not be selected on my system due to file permissions in Ubuntu. As a result, I was unable to get the addon to work until after I changed the file permissions for all files and folders in userdata/addon_data/script.module.zap2epg.

I commented out the two "if" sections in zap2epg.py that delete files if there are TBA entries. If the TBA condition is true then the .gz file from Zap2it is deleted and this was causing gaps in the guide on Kodi (each .gz file covers many episodes).

Episode titles were missing from files recorded by TVH. After some investigation I found that eptitle is being set as epshow in zap2epg.py (line 326). Also, when eptitle is saved to the xmltv.xml file the xml tags are set as title, not sub-title as they should be (lines 329/331). Safetitle was only being applied to eptitle (actually epshow the way it was coded). So I corrected the eptitle errors and changed the epshow section to follow the safetitle process. All seems to work correctly now for my system.

Starting on line 323, the resulting code is:

                            if edict['epshow'] is not None:
                                titleShow = re.sub('&','&', edict['epshow'])
                                if stitle == "true":
                                    safeShow = re.sub('[\\/*?:"<>|]', "_", titleShow)
                                    fh.write('\t\t<title lang=\"' + lang + '\">' + safeShow + '</title>\n')
                                else:
                                    fh.write('\t\t<title lang=\"' + lang + '\">' + titleShow + '</title>\n')
                            if edict['eptitle'] is not None:
                                titleEpisode = re.sub('&','&amp;', edict['eptitle'])
                                if stitle == "true":
                                    safeEpisode = re.sub('[\\/*?:"<>|]', "_", titleEpisode)
                                    fh.write('\t\t<sub-title lang=\"' + lang + '\">' + safeEpisode + '</sub-title>\n')
                                else:
                                    fh.write('\t\t<sub-title lang=\"' + lang + '\">' + titleEpisode + '</sub-title>\n')

Again, thanks for your work on this addon. If you need a beta tester let me know and I will set up a fresh DVR system on one of my computers.

Thanks,

oldguy327