Berimor66 / mythbox

Automatically exported from code.google.com/p/mythbox
GNU General Public License v2.0
0 stars 1 forks source link

Changes to the recording schedule do not take effect immediately #147

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Schedule a new recording
2. Go to Upcoming recordings

What is the expected output? What do you see instead?

I would expect to see the recording visible immediately

What version of the product are you using? On what operating system?

XBMC Dharma 10.0
Mythbox 1.0.1
Mythtv 0.23.1

Please provide any additional information below.

The schedule change is only noticed when mythtv-backend eventually runs a 
periodic reschedule, which might take some minutes. Althought MythBox correctly 
adds the new row to the recording table, I'm guessing it fails to issue the 
RESCHEDULE RECORDINGS command over the Myth Protocol. If it did this, then 
recording changes would show up almost immediatly.

See http://www.mythtv.org/wiki/RESCHEDULE_RECORDINGS_%28Myth_Protocol%29

Original issue reported on code.google.com by banksdav...@gmail.com on 16 Jan 2011 at 2:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Actually, it does seem to do request a RESCHEDULE_RECORDINGS, but with recordid 
of 0, rather using than the newly created scheduleId value.

Here's my backend log following the creation of a new schedule.
2011-01-16 14:33:49.929 Reschedule requested for id 0.
2011-01-16 14:33:50.372 Scheduled 54 items in 0.2 = 0.00 match + 0.20 place

For some reason, the scheduleNotify code is unable to get a valid scheduleId:

    def rescheduleNotify(self, schedule=None):
        """
        Method to instruct the backend to reschedule recordings.  If the
        schedule is not specified, all recording schedules will be rescheduled
        by the backend.
        """
        log.debug('rescheduleNotify(schedule= %s)' % safe_str(schedule))
        scheduleId = 0
        if schedule:
            scheduleId = schedule.getScheduleId()
            if scheduleId is None:
                scheduleId = 0
        reply = self._sendRequest(self.cmdSock, ['RESCHEDULE_RECORDINGS %s' % scheduleId])
        if int(reply[0]) < 0:
            raise ServerException, 'Reschedule notify failed: %s' % reply

Changing the default from 0 to -1 causes myth-backend to reschedule all 
recordings, which has the desired effect, but is less efficient than specifying 
the correct scheduleId.

Original comment by banksdav...@gmail.com on 16 Jan 2011 at 2:45

GoogleCodeExporter commented 9 years ago
Thanks for the detailed bug report. Issue fixed in revision 1c56c2ca43. 

Original comment by semir.pa...@gmail.com on 20 Jan 2011 at 4:36