Пример #1
0
	def RecordDateInputClosed(self, ret = None):
		if ret[0]:
			begin = ret[1]
			end = ret[2]
			info = { }

			name = glob.currentepglist[glob.currentchannelistindex][3]
			description = glob.currentepglist[glob.currentchannelistindex][4]
			eventid = glob.currentepglist[glob.currentchannelistindex][1]

			self.getProgramInfoAndEvent(info, name)
			serviceref = info["serviceref"]

			if isinstance(serviceref, eServiceReference):
				serviceref = ServiceReference(serviceref)

			recording = RecordTimerEntry(serviceref, begin, end, name, description, eventid, dirname = str(cfg.downloadlocation.getValue()))
			recording.dontSave = True

			simulTimerList = self.session.nav.RecordTimer.record(recording)

			if simulTimerList is None:	# no conflict
				recording.autoincrease = False
				self.recording.append(recording)

				self.session.open(MessageBox, _('Recording Started.'), MessageBox.TYPE_INFO, timeout=5)
			else:
				self.session.open(MessageBox, _('Recording Failed.'), MessageBox.TYPE_WARNING)
				return
		else:
			self.session.open(MessageBox, _('Recording Failed.'), MessageBox.TYPE_WARNING)
			return
Пример #2
0
    def startConvert(self):
        if not self.checkBeforeStartConvert():
            return

        self.currentPvr = self.pvrLists.pop(0)
        if self.currentPvr is None:
            return

        (_begin, sref, name, length, real_ref) = self.currentPvr

        m_path = sref.getPath()
        sref = eServiceReference(real_ref + m_path)

        begin = int(time.time())
        end = begin + 3600  # dummy
        #end = begin + int(length) + 2
        description = ""
        eventid = None

        if isinstance(sref, eServiceReference):
            sref = ServiceReference(sref)

        if m_path.endswith('.ts'):
            m_path = m_path[:-3]

        filename = m_path + "_pvrdesc"

        recording = RecordTimerEntry(sref,
                                     begin,
                                     end,
                                     name,
                                     description,
                                     eventid,
                                     dirname=preferredInstantRecordPath(),
                                     filename=filename)
        recording.dontSave = True
        recording.autoincrease = True
        recording.setAutoincreaseEnd()
        recording.pvrConvert = True  # do not handle evStart event

        nav = self.getNavigation()
        simulTimerList = nav.RecordTimer.record(recording)
        if simulTimerList is None:  # no conflict
            recordings = self.getRecordings()
            if len(recordings) == 1:
                self.converting = recording
                self.convertFilename = (sref.getPath(), filename + ".ts")
            else:
                print "[PVRDescrambleConvert] error, wrong recordings info."
        else:
            self.currentPvr = None
            self.startConvertTimer()

            if len(simulTimerList) > 1:  # with other recording
                print "[PVRDescrambleConvert] conflicts !"
            else:
                print "[PVRDescrambleConvert] Couldn't record due to invalid service %s" % sref
            recording.autoincrease = False

        print "[PVRDescrambleConvert] startConvert, self.converting : ", self.converting
Пример #3
0
    def RecordDateInputClosed(self, ret=None):
        if ret:
            begin = ret[1]
            end = ret[2]
            name = ret[3]

            description = glob.currentepglist[glob.currentchannelistindex][4]
            eventid = int(self.streamurl.rpartition('/')[-1].partition('.')[0])
            serviceref = eServiceReference(1, 0, self.streamurl)

            if isinstance(serviceref, eServiceReference):
                serviceref = ServiceReference(serviceref)

            recording = RecordTimerEntry(serviceref, begin, end, name, description, eventid, dirname=str(cfg.downloadlocation.getValue()))
            recording.dontSave = True

            simulTimerList = self.session.nav.RecordTimer.record(recording)

            if simulTimerList is None:  # no conflict
                recording.autoincrease = False

                self.session.open(MessageBox, _('Recording Timer Set.'), MessageBox.TYPE_INFO, timeout=5)
            else:
                self.session.open(MessageBox, _('Recording Failed.'), MessageBox.TYPE_WARNING)
                return
        else:
            return
Пример #4
0
    def recordNow(self, param):
        if not config.misc.recording_allowed.value:
            return (False, _("Recording is currently disabled!"))

        limitEvent = True
        if param == "undefinitely" or param == "infinite":
            ret = (True, "Infinite Instant recording started")
            limitEvent = False
        else:
            ret = (True, "Instant record for current Event started")

        serviceref = ServiceReference(
            self.session.nav.getCurrentlyPlayingServiceReference().toString())

        event = None

        try:
            service = self.session.nav.getCurrentService()
            event = service.info().getEvent(0)
        except Exception:
            print "[Webcomponents.Timer] recordNow Exception!"

        begin = time()
        end = begin + 3600 * 10
        name = "instant record"
        description = ""
        eventid = 0

        if event is not None:
            curEvent = parseEvent(event)
            name = curEvent[2]
            description = curEvent[3]
            eventid = curEvent[4]
            if limitEvent:
                end = curEvent[1]
        else:
            if limitEvent:
                ret = (False, "No event found! Not recording!")

        if ret[0]:
            location = preferredInstantRecordPath()
            timer = RecordTimerEntry(serviceref,
                                     begin,
                                     end,
                                     name,
                                     description,
                                     eventid,
                                     False,
                                     False,
                                     0,
                                     dirname=location)
            timer.dontSave = True
            recRet = self.recordtimer.record(timer)
            if recRet is not None:
                # a conflict is rather unlikely, but this can also indicate a non-recordable service
                ret = (False, "Timer conflict detected! Not recording!")

        return ret
Пример #5
0
def recordNow(session, infinite):
    rt = session.nav.RecordTimer
    serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()

    try:
        event = session.nav.getCurrentService().info().getEvent(0)
    except Exception:
        event = None

    if not event and not infinite:
        return {
            "result": False,
            "message": _("No event found! Not recording!")
        }

    if event:
        (begin, end, name, description, eit) = parseEvent(event)
        begin = time()
        msg = _("Instant record for current Event started")
    else:
        name = "instant record"
        description = ""
        eit = 0

    if infinite:
        begin = time()
        end = begin + 3600 * 10
        msg = _("Infinite Instant recording started")

    timer = RecordTimerEntry(ServiceReference(serviceref),
                             begin,
                             end,
                             name,
                             description,
                             eit,
                             False,
                             False,
                             0,
                             dirname=preferredInstantRecordPath())
    timer.dontSave = True

    if rt.record(timer):
        return {
            "result": False,
            "message": _("Timer conflict detected! Not recording!")
        }
    nt = {
        "serviceref": str(timer.service_ref),
        "servicename": removeBad(timer.service_ref.getServiceName()),
        "eit": timer.eit,
        "name": timer.name,
        "begin": timer.begin,
        "end": timer.end,
        "duration": timer.end - timer.begin
    }

    return {"result": True, "message": msg, "newtimer": nt}
Пример #6
0
def recordNow(session, infinite):
	rt = session.nav.RecordTimer
	serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()

	try:
		event = session.nav.getCurrentService().info().getEvent(0)
	except Exception:
		event = None
		
	if not event and not infinite:
		return {
			"result": False,
			"message": "No event found! Not recording!"
		}
		
	if event:
		(begin, end, name, description, eit) = parseEvent(event)
		begin = time()
		msg = "Instant record for current Event started"
	else:
		name = "instant record"
		description = ""
		eit = 0
		
	if infinite:
		begin = time()
		end = begin + 3600 * 10
		msg = "Infinite Instant recording started"
		
	timer = RecordTimerEntry(
		ServiceReference(serviceref),
		begin,
		end,
		name,
		description, 
		eit,
		False,
		False,
		0,
		dirname=preferredInstantRecordPath()
	)
	timer.dontSave = True
	
	if rt.record(timer):
		return {
			"result": False,
			"message": "Timer conflict detected! Not recording!"
		}
		
	return {
		"result": True,
		"message": msg
	}
	
Пример #7
0
def recordNow(session, infinite):
	rt = session.nav.RecordTimer
	serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()

	try:
		event = session.nav.getCurrentService().info().getEvent(0)
	except Exception:
		event = None
		
	if not event and not infinite:
		return {
			"result": False,
			"message": "No event found! Not recording!"
		}
		
	if event:
		(begin, end, name, description, eit) = parseEvent(event)
		begin = time()
		msg = "Instant record for current Event started"
	else:
		name = "instant record"
		description = ""
		eit = 0
		
	if infinite:
		begin = time()
		end = begin + 3600 * 10
		msg = "Infinite Instant recording started"
		
	timer = RecordTimerEntry(
		ServiceReference(serviceref),
		begin,
		end,
		name,
		description, 
		eit,
		False,
		False,
		0,
		dirname=preferredInstantRecordPath()
	)
	timer.dontSave = True
	
	if rt.record(timer):
		return {
			"result": False,
			"message": "Timer conflict detected! Not recording!"
		}
		
	return {
		"result": True,
		"message": msg
	}
Пример #8
0
    def recordNow(self, param):
        limitEvent = True
        if param == "undefinitely" or param == "infinite":
            ret = (True, "Infinite Instant recording started")
            limitEvent = False
        else:
            ret = (True, "Instant record for current Event started")

        serviceref = ServiceReference(
            self.session.nav.getCurrentlyPlayingServiceReference().toString())

        event = None

        try:
            service = self.session.nav.getCurrentService()
            event = service.info().getEvent(0)
        except Exception:
            print "[Webcomponents.Timer] recordNow Exception!"

        begin = time()
        end = begin + 3600 * 10
        name = "instant record"
        description = ""
        eventid = 0

        if event is not None:
            curEvent = parseEvent(event)
            name = curEvent[2]
            description = curEvent[3]
            eventid = curEvent[4]
            if limitEvent:
                end = curEvent[1]
        else:
            if limitEvent:
                ret = (False, "No event found! Not recording!")

        if ret[0]:
            location = config.movielist.last_videodir.value
            timer = RecordTimerEntry(serviceref,
                                     begin,
                                     end,
                                     name,
                                     description,
                                     eventid,
                                     False,
                                     False,
                                     0,
                                     dirname=location)
            timer.dontSave = True
            self.recordtimer.record(timer)

        return ret
Пример #9
0
	def recordNow(self, param):
		if not config.misc.recording_allowed.value:
			return (False, _("Recording is currently disabled!"))

		limitEvent = True
		if param == "undefinitely" or param == "infinite":
			ret = (True, "Infinite Instant recording started")
			limitEvent = False
		else:
			ret = ( True, "Instant record for current Event started" )

		serviceref = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference().toString())

		event = None

		try:
			service = self.session.nav.getCurrentService()
			event = service.info().getEvent(0)
		except Exception:
			print "[Webcomponents.Timer] recordNow Exception!"

		begin = time()
		end = begin + 3600 * 10
		name = "instant record"
		description = ""
		eventid = 0

		if event is not None:
			curEvent = parseEvent(event)
			name = curEvent[2]
			description = curEvent[3]
			eventid = curEvent[4]
			if limitEvent:
				end = curEvent[1]
		else:
			if limitEvent:
				ret = ( False, "No event found! Not recording!" )

		if ret[0]:
			location = preferredInstantRecordPath()
			timer = RecordTimerEntry(serviceref, begin, end, name, description, eventid, False, False, 0, dirname=location)
			timer.dontSave = True
			recRet = self.recordtimer.record(timer)
			if recRet is not None:
				# a conflict is rather unlikely, but this can also indicate a non-recordable service
				ret = (False, "Timer conflict detected! Not recording!" )

		return ret
Пример #10
0
    def recordNow(self, param):
        limitEvent = True
        if param == "undefinitely" or param == "infinite":
            ret = (True, "Infinite Instant recording started")
            limitEvent = False
        else:
            ret = (True, "Instant record for current Event started")

        serviceref = ServiceReference(self.session.nav.getCurrentlyPlayingServiceReference().toString())

        event = None

        try:
            service = self.session.nav.getCurrentService()
            event = service.info().getEvent(0)
        except Exception:
            print "[Webcomponents.Timer] recordNow Exception!"

        begin = time()
        end = begin + 3600 * 10
        name = "instant record"
        description = ""
        eventid = 0

        if event is not None:
            curEvent = parseEvent(event)
            name = curEvent[2]
            description = curEvent[3]
            eventid = curEvent[4]
            if limitEvent:
                end = curEvent[1]
        else:
            if limitEvent:
                ret = (False, "No event found! Not recording!")

        if ret[0]:
            location = config.movielist.last_videodir.value
            timer = RecordTimerEntry(
                serviceref, begin, end, name, description, eventid, False, False, 0, dirname=location
            )
            timer.dontSave = True
            self.recordtimer.record(timer)

        return ret
Пример #11
0
def recordNow(session, infinite):
	rt = session.nav.RecordTimer
	serviceref = session.nav.getCurrentlyPlayingServiceReference().toString()

	try:
		event = session.nav.getCurrentService().info().getEvent(0)
	except Exception:
		event = None

	if not event and not infinite:
		return {
			"result": False,
			"message": _("No event found! Not recording!")
		}

	if event:
		(begin, end, name, description, eit) = parseEvent(event)
		begin = time()
		msg = _("Instant record for current Event started")
	else:
		name = "instant record"
		description = ""
		eit = 0

	if infinite:
		begin = time()
		end = begin + 3600 * 10
		msg = _("Infinite Instant recording started")

	timer = RecordTimerEntry(
		ServiceReference(serviceref),
		begin,
		end,
		name,
		description, 
		eit,
		False,
		False,
		0,
		dirname=preferredInstantRecordPath()
	)
	timer.dontSave = True

	if rt.record(timer):
		return {
			"result": False,
			"message": _("Timer conflict detected! Not recording!")
		}
	nt = {
		"serviceref": str(timer.service_ref),
		"servicename": timer.service_ref.getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', ''),
		"eit": timer.eit,
		"name": timer.name,
		"begin": timer.begin,
		"end": timer.end,
		"duration": timer.end - timer.begin
	}

	return {
		"result": True,
		"message": msg,
		"newtimer": nt
	}