google / sagetv

SageTV is a cross-platform networked DVR and media management system
http://forums.sagetv.com/
Apache License 2.0
267 stars 173 forks source link

Schedules Direct EPG data not updating because of null station instance in code #365

Open stevep699 opened 7 years ago

stevep699 commented 7 years ago

User wnjj on the SageTV forums suggested I list this problem here.

I have been using Sage for many years and updated to V9 last spring. I enabled the Schedules Direct EPG in June. It has worked fine until the last couple of weeks. I updated to version 9.1.7 yesterday. No change in behavior. The epg information from my sagetv_0.txt file shows:

Thu 10/5 11:30:11.347 [EPG@d13ca8] SDEPG got 103 channels Thu 10/5 11:30:11.376 [EPG@d13ca8] SDEPG Exception thrown: null Thu 10/5 11:30:11.376 [EPG@d13ca8] java.lang.NullPointerException Thu 10/5 11:30:11.376 [EPG@d13ca8] at sage.epg.sd.SDRipper.extractGuide(SDRipper.java:1364)

My Sage System Information always shows the last epg update as the current time and next update time as 0.

User wnjj stated: "Looks like there's another bug in the SDEPG code where a null isn't being checked. I don't know why it's null.

The getStationID() function call is invalid because the station instance is null.

In SDRipper.java:

                        for (int i = 0; i < numChans; i++)
                        {
                             SDStation station = map.getStations()[i];

                              int stationID = station.getStationID();"

Any help resolving this would be greatly appreciated. I will run out of epg data next Thursday.

Steve

enternoescape commented 7 years ago

We should not need to check for nulls in this code because if the station ID is missing, we've got a bigger problem with the JSON coming in from Schedules Direct. Namely if we check for a null here, we would have no idea what station ID the data is associated with. What would help the most here is to enable JSON logging in SageTV and post the JSON log when this exception happens. That will help us determine if we have an issue in the SageTV code or Schedules Direct needs to fix a station.

wnjj commented 7 years ago

It still may make sense to check for null stations since right now a problem with a single station takes out whole EPG process. Now if all stations are null or there's no easy way to skip that bad station then you're right and there's nothing to be gained.

Either way, thanks for your support!

enternoescape commented 7 years ago

I'll take a look at making this when I can. Unfortunately, the timing could not be worse; my wife gave birth on 10/5 to my first child after a 43 hour labor. We are both completely exhausted.

wnjj commented 7 years ago

Wow! I'm surprised you're even online. Congratulations!

Welcome to parenthood. You'll have plenty more nights of exhaustion ahead but worth every bit. We've got 3 girls: 4, 7 and 9 years old.

With SD fixing their side, there's no hurry. Get sleep when you can.

stevep699 commented 7 years ago

Thanks to both of you for looking into this issue. After SD fixed their side, my system works great again! Enternoescape congratulations on your new kid!

Steve

enternoescape commented 7 years ago

Thanks everyone. I really think I need to redefine what I consider tired. We took a lot of classes prior, but there's still so much you learn.