def recording_add(self, name, channel, priority, start, stop, **info): """ add a new recording """ log.info("recording.add: %s", name) r = Recording(name, channel, priority, start, stop, info=info) if r in self.recordings: r = self.recordings[self.recordings.index(r)] if r.status == DELETED: r.status = CONFLICT r.favorite = False # update schedule, this will also send an update to all # clients registered. self.reschedule() return r raise AttributeError("Already scheduled") self.recordings.append(r) self.reschedule() return r
def recording_add(self, name, channel, priority, start, stop, **info): """ add a new recording """ log.info('recording.add: %s', name) r = Recording(name, channel, priority, start, stop, info=info) if r in self.recordings: r = self.recordings[self.recordings.index(r)] if r.status == DELETED: r.status = CONFLICT r.favorite = False # update schedule, this will also send an update to all # clients registered. self.reschedule() return r raise AttributeError('Already scheduled') self.recordings.append(r) self.reschedule() return r