JSON service questions and issues

Re: JSON service questions and issues

Postby rich987 » Wed Oct 22, 2014 9:18 pm

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.
rich987
 
Posts: 1
Joined: Wed Oct 22, 2014 8:15 pm

Re: JSON service questions and issues

Postby rkulagow » Thu Oct 23, 2014 12:03 pm

I'll need to look at that, but it will probably be the next version of the API that standardizes the responses.
rkulagow
SD Staff
 
Posts: 911
Joined: Tue Aug 14, 2007 3:15 pm

Update Script Ran for 7h - Manually Aborted

Postby martyg » Sat Oct 25, 2014 6:22 am

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.
Attachments
sd-json-beta.log.gz
(265.18 KiB) Downloaded 254 times
martyg
 
Posts: 9
Joined: Thu Feb 21, 2013 6:55 am

Re: JSON service questions and issues

Postby rkulagow » Sat Oct 25, 2014 7:36 am

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.

Thanks.
rkulagow
SD Staff
 
Posts: 911
Joined: Tue Aug 14, 2007 3:15 pm

Re: JSON service questions and issues

Postby martyg » Sat Oct 25, 2014 7:39 am

As I said in 2nd paragraph, retries worked fine.
martyg
 
Posts: 9
Joined: Thu Feb 21, 2013 6:55 am

Re: JSON service questions and issues

Postby rkulagow » Sat Oct 25, 2014 9:06 am

Sorry missed that when I was composing the reply. That means it's something that I need to fix in the client.
rkulagow
SD Staff
 
Posts: 911
Joined: Tue Aug 14, 2007 3:15 pm

JSON Update Scheduling - MythTV backend

Postby martyg » Mon Oct 27, 2014 7:55 am

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/mfdb.sh | NULL     |
| MythFillMaxHour               | 23                          | NULL     |
| MythFillGrabberSuggestsTime   | 1                           | NULL     |
+-------------------------------+-----------------------------+----------+
martyg
 
Posts: 9
Joined: Thu Feb 21, 2013 6:55 am

Re: JSON service questions and issues

Postby jimyth » Tue Oct 28, 2014 8:56 pm

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.
jimyth
 
Posts: 3
Joined: Tue Oct 28, 2014 8:09 pm

Re: JSON service questions and issues

Postby rkulagow » Wed Oct 29, 2014 7:07 am

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.

Thanks.
rkulagow
SD Staff
 
Posts: 911
Joined: Tue Aug 14, 2007 3:15 pm

Previous

Return to Developer

Who is online

Users browsing this forum: No registered users and 4 guests

cron