Page 2 of 2

Re: JSON service questions and issues

Posted: Wed Oct 22, 2014 9:18 pm
by rich987
Question on JSON design of the status reply.

For the JSON reply to status requests, the "account" information is formatted this way:

"account": {
"expires": "2014-06-28T05:16:29Z",
"messages": [],
"maxLineups": 16,
"nextSuggestedConnectTime": "2014-05-20T16:32:12Z"

But the "systemStatus" is formatted this way:

"systemStatus": [
"date": "2012-12-17T16:24:47Z",
"status": "Online",
"details": "All servers running normally."

Is there a reason why "systemStatus" maps to an array, the array containing a single object, yet "account" does not?

Why is "systemStatus" not also formatted the same as "account"? Is there some underlying reason I'm not seeing for the difference.

Re: JSON service questions and issues

Posted: Thu Oct 23, 2014 12:03 pm
by rkulagow
I'll need to look at that, but it will probably be the next version of the API that standardizes the responses.

Update Script Ran for 7h - Manually Aborted

Posted: Sat Oct 25, 2014 6:22 am
by martyg
Update task last night did not go well. Still churning after 7 hours.
Killed the processes and attached log file for you.

Manual run right after that reported no new programs to fetch.
Ran once again with --force to make sure I am in sync, and that looked OK.
Will leave alone until next scheduled run.

Re: JSON service questions and issues

Posted: Sat Oct 25, 2014 7:36 am
by rkulagow
OK, it looks like my retry logic isn't working the way it should; but if you re-run the download does it work?

That will help me determine if the fault is on the server side (the stations that you're requesting aren't available) or on the client side.


Re: JSON service questions and issues

Posted: Sat Oct 25, 2014 7:39 am
by martyg
As I said in 2nd paragraph, retries worked fine.

Re: JSON service questions and issues

Posted: Sat Oct 25, 2014 9:06 am
by rkulagow
Sorry missed that when I was composing the reply. That means it's something that I need to fix in the client.

JSON Update Scheduling - MythTV backend

Posted: Mon Oct 27, 2014 7:55 am
by martyg
I noticed my JSON testbed Myth backend seems to ignore MythFillSuggestedRunTime.
Instead of using the suggested time, the backend runs the update at mignight localtime daily.

I have carefully reviewed all settings, and I'm stumped.
Not sure how this could be a JSON downloader side-effect, but I though I would ask.

BTW, the upstream mythfilldatabase program updates mythfilldatabaseLastRunStart and mythfilldatabaseLastRunEnd to GMT, not localtime, but I'm pretty sure this is not what is causing this.
You might want to tweak how these two fields are updated for consistency.

Here are the relevant settings pulled from the JSON testbed database:

Code: Select all

$ mysql -t mythconverg -e 'select * from settings where value like "%mythfill%";'
| value                         | data                        | hostname |
| mythfilldatabaseLastRunStatus | Successful.                 | NULL     |
| mythfilldatabaseLastRunEnd    | 2014-10-27 07:01:52         | NULL     |
| mythfilldatabaseLastRunStart  | 2014-10-27 07:00:32         | NULL     |
| MythFillSuggestedRunTime      | 2014-10-27T14:51:33Z        | NULL     |
| MythFillDatabaseArgs          |                             | NULL     |
| MythFillEnabled               | 1                           | NULL     |
| MythFillDatabasePath          | /var/lib/mythtv/bin/ | NULL     |
| MythFillMaxHour               | 23                          | NULL     |
| MythFillGrabberSuggestsTime   | 1                           | NULL     |

Re: JSON service questions and issues

Posted: Tue Oct 28, 2014 8:56 pm
by jimyth
Thanks for the work done so far. The schedule updates are noticeably faster than the old system.

Background: I have 4 digital OTA tuners, 2 analog cable tuners, and a firewire connection for digital cable.

These are the growing pains I encountered in the transition.

In using the sd-utility.php I initially reused the videosources and change the lineup associations but that didn't work. I guess that not adding the videosource in this utility meant that the the association wasn't properly tied together in the schedulesdirect mysql database.

Deleting the old videosources meant old recorded shows lost the associated channel icons for displaying in mythweb. No biggie since shows are all still listed.

Updating the videosource clobbers all the channels for that source and re-adds them with visible=1 after I painstakingly set visible=0 to about more than 100 cablebox channels I don't subscribe to. It then didn't re-add the channel icon filename to the channels table.

I hacked up my sd-utility.php so I could do an update which saves the xmltvid & visible setting and restores that when re-inserting the channel and added a flag to force icon downloads when updating. I'm sure you could make it smarter and actually update only changed channel information, not clobber certain settings, and download missing icons for only the visible channels.

For schedule update logging - I'd like to see a little bit more information about what days and times were updated if possible. With mythfilldatabase I would try to make sure the latest daily information was updated prior to the nightly primetime incase there were any schedule changes. That might have been paranoid or just silly expecting the source would be able to get updates within a few hours of show start times.

Re: JSON service questions and issues

Posted: Wed Oct 29, 2014 7:07 am
by rkulagow
Can you send me a git diff as a private message so that I can use your code as a starting point? There's always more things that need to be written, and only so many cycles in a day.