Exemple #1
0
	def calculateFilename(self):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))

#		print "begin_date: ", begin_date
#		print "service_name: ", service_name
#		print "name:", self.name
#		print "description: ", self.description
#
		filename = begin_date + " - " + service_name
		if self.name:
			if config.recording.filename_composition.getValue() == "short":
				filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + self.name
			elif config.recording.filename_composition.getValue() == "long":
				filename += " - " + self.name + " - " + self.description
			else:
				filename += " - " + self.name # standard

		if config.recording.ascii_filenames.getValue():
			filename = ASCIItranslit.legacyEncode(filename)


		if not self.dirname:
			dirname = findSafeRecordPath(defaultMoviePath())
		else:
			dirname = findSafeRecordPath(self.dirname)
			if dirname is None:
				dirname = findSafeRecordPath(defaultMoviePath())
				self.dirnameHadToFallback = True
		if not dirname:
			return None
		self.Filename = Directories.getRecordingFilename(filename, dirname)
		self.log(0, "Filename calculated as: '%s'" % self.Filename)
		return self.Filename
Exemple #2
0
    def calculateFilename(self):
        service_name = self.service_ref.getServiceName()
        begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
        begin_shortdate = strftime("%Y%m%d", localtime(self.begin))

        print "begin_date: ", begin_date
        print "service_name: ", service_name
        print "name:", self.name
        print "description: ", self.description

        filename = begin_date + " - " + service_name
        if self.name:
            if config.usage.setup_level.index >= 2:  # expert+
                if config.recording.filename_composition.value == "short":
                    filename = begin_shortdate + " - " + self.name
                elif config.recording.filename_composition.value == "long":
                    filename += " - " + self.name + " - " + self.description
                else:
                    filename += " - " + self.name  # standard
            else:
                filename += " - " + self.name

        if config.recording.ascii_filenames.value:
            filename = ASCIItranslit.legacyEncode(filename)

        if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
            if self.dirname:
                self.dirnameHadToFallback = True
            dirname = defaultMoviePath()
        else:
            dirname = self.dirname
        self.Filename = Directories.getRecordingFilename(filename, dirname)
        self.log(0, "Filename calculated as: '%s'" % self.Filename)
Exemple #3
0
    def calculateFilename(self):
        service_name = self.service_ref.getServiceName()
        begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))

        print "begin_date: ", begin_date
        print "service_name: ", service_name
        print "name:", self.name
        print "description: ", self.description

        filename = begin_date + " - " + service_name
        if self.name:
            if config.recording.filename_composition.getValue() == "short":
                filename = strftime("%Y%m%d", localtime(
                    self.begin)) + " - " + self.name
            elif config.recording.filename_composition.getValue() == "long":
                filename += " - " + self.name + " - " + self.description
            else:
                filename += " - " + self.name  # standard

        if config.recording.ascii_filenames.getValue():
            filename = ASCIItranslit.legacyEncode(filename)

        if not self.dirname:
            dirname = findSafeRecordPath(defaultMoviePath())
        else:
            dirname = findSafeRecordPath(self.dirname)
            if dirname is None:
                dirname = findSafeRecordPath(defaultMoviePath())
                self.dirnameHadToFallback = True
        if not dirname:
            return None
        self.Filename = Directories.getRecordingFilename(filename, dirname)
        self.log(0, "Filename calculated as: '%s'" % self.Filename)
        return self.Filename
	def calculateFilename(self):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
		begin_shortdate = strftime("%Y%m%d", localtime(self.begin))
		
		print "begin_date: ", begin_date
		print "service_name: ", service_name
		print "name:", self.name
		print "description: ", self.description
		
		filename = begin_date + " - " + service_name
		if self.name:
			if config.usage.setup_level.index >= 2: # expert+
				if config.recording.filename_composition.value == "short":
					filename = begin_shortdate + " - " + self.name
				elif config.recording.filename_composition.value == "long":
					filename += " - " + self.name + " - " + self.description
				else:
					filename += " - " + self.name # standard
			else:
				filename += " - " + self.name

		if config.recording.ascii_filenames.value:
			filename = ASCIItranslit.legacyEncode(filename)

		if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
			if self.dirname:
				self.dirnameHadToFallback = True
			dirname = defaultMoviePath()
		else:
			dirname = self.dirname
		self.Filename = Directories.getRecordingFilename(filename, dirname)
		self.log(0, "Filename calculated as: '%s'" % self.Filename)
	def calculateFilename(self, name=None):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
		name = name or self.name
		filename = begin_date + " - " + service_name
		if name:
			if config.recording.filename_composition.value == "event":
				filename = name + ' - ' + begin_date + "_" + service_name
			elif config.recording.filename_composition.value == "short":
				filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + name
			elif config.recording.filename_composition.value == "long":
				filename += " - " + name + " - " + self.description
			else:
				filename += " - " + name # standard

		if config.recording.ascii_filenames.value:
			filename = ASCIItranslit.legacyEncode(filename)
		if not self.dirname:
			dirname = (defaultMoviePath())
		else:
			dirname = (self.dirname)
			if dirname is None:
				dirname = (defaultMoviePath())
				self.dirnameHadToFallback = True
		if not dirname:
			return None
		self.Filename = Directories.getRecordingFilename(filename, dirname)
		self.log(0, "Filename calculated as: '%s'" % self.Filename)
		return self.Filename
Exemple #6
0
    def calculateFilename(self):
        service_name = self.service_ref.getServiceName()
        begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))

        #		print "begin_date: ", begin_date
        #		print "service_name: ", service_name
        #		print "name:", self.name
        #		print "description: ", self.description
        #
        filename = begin_date + " - " + service_name
        if self.name:
            if config.recording.filename_composition.getValue() == "short":
                filename = strftime("%Y%m%d", localtime(
                    self.begin)) + " - " + self.name
            elif config.recording.filename_composition.getValue() == "long":
                filename += " - " + self.name + " - " + self.description
            else:
                filename += " - " + self.name  # standard

        if config.recording.ascii_filenames.getValue():
            filename = ASCIItranslit.legacyEncode(filename)

        self.Filename = Directories.getRecordingFilename(
            filename, self.MountPath)
        self.log(0, "Filename calculated as: '%s'" % self.Filename)
        return self.Filename
Exemple #7
0
	def calculateFilename(self, record_service=None):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))
		begin_shortdate = strftime("%Y%m%d", localtime(self.begin))
		
		print("begin_date: ", begin_date)
		print("service_name: ", service_name)
		print("name:", self.name)
		print("description: ", self.description)
		
		filename = begin_date + " - " + service_name
		if self.name:
			if config.usage.setup_level.index >= 2: # expert+
				if config.recording.filename_composition.value == "short":
					filename = begin_shortdate + " - " + self.name
				elif config.recording.filename_composition.value == "long":
					filename += " - " + self.name + " - " + self.description
				else:
					filename += " - " + self.name # standard
			else:
				filename += " - " + self.name

		if config.recording.ascii_filenames.value:
			filename = ASCIItranslit.legacyEncode(filename)

		if not self.dirname or not Directories.fileExists(self.dirname, 'w'):
			if self.dirname:
				self.dirnameHadToFallback = True
			dirname = defaultMoviePath()
			self.log(0, "Directory '%s' doesn't seem to exist or isn't writable. Falling back to default movie path '%s'." % (self.dirname, dirname))
		else:
			dirname = self.dirname
		self.Filename = Directories.getRecordingFilename(filename, dirname) + (".ts" if record_service is None else record_service.getFileExtension())

		self.log(0, "Filename calculated as: '%s'" % self.Filename)
Exemple #8
0
	def calculateFilename(self):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))

#		print "begin_date: ", begin_date
#		print "service_name: ", service_name
#		print "name:", self.name
#		print "description: ", self.description
#
		filename = begin_date + " - " + service_name
		if self.name:
			if config.recording.filename_composition.value == "veryveryshort":
				filename = self.name
			elif config.recording.filename_composition.value == "veryshort":
				filename = self.name + " - " + begin_date
			elif config.recording.filename_composition.value == "short":
				filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + self.name
			elif config.recording.filename_composition.value == "long":
				filename += " - " + self.name + " - " + self.description
			else:
				filename += " - " + self.name # standard

		if config.recording.ascii_filenames.value:
			filename = ASCIItranslit.legacyEncode(filename)

		self.Filename = Directories.getRecordingFilename(filename, self.MountPath)
		if debug:
			self.log(0, "Filename calculated as: '%s'" % self.Filename)
		return self.Filename
	def __init__(self, session, movieinfo, movietitle):
		self.skin = PlayRtmpMovie.skin
		Screen.__init__(self, session)

		self.url = movieinfo[0]
		self.filename = movieinfo[1]
		self.movietitle = movietitle
		self.movieinfo = movieinfo
		self.destination = config.mediaportal.storagepath.value
		self.moviepath = self.destination + ASCIItranslit.legacyEncode(self.filename)
		
		self.streamactive = False
		self.isVisible = True

		self.container=eConsoleAppContainer()
		self.container.appClosed.append(self.copyfinished)
		self.container.stdoutAvail.append(self.progressUpdate)
		self.container.stderrAvail.append(self.progressUpdate)
		self.container.setCWD(self.destination)

		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()

		self.BgFileEraser = eBackgroundFileEraser.getInstance()

		filesize = 0
		self.filesize = float(filesize) # in bytes

		self.dummyfilesize = False
		self.lastcmddata = None
		self.lastlocalsize = 0
		self.localsize = 0
		self.isplaying = False
		self.autoplaythreshold = config.mediaportal.autoplayThreshold.value

		self["key_green"] = Button(_("Play"))
		self["key_red"] = Button(_("Cancel"))
		self["key_blue"] = Button(_("Show/Hide"))

		self["label_filename"] = StaticText("File: %s" % (self.filename))
		self["label_progress"] = StaticText("Progress: N/A")
		self["label_speed"] = StaticText("Speed: N/A")
		self["label_timeleft"] = StaticText("Time left: N/A")

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel": self.exit,
			"ok": self.okbuttonClick,
			"red": self.exit,
			"green": self.playfile,
			"blue": self.visibility
		}, -1)

		self.StatusTimer = eTimer()
		self.StatusTimer.callback.append(self.UpdateStatus)

		self.activityslider = Slider(0, 100)
		self["activityslider"] = self.activityslider

		self.onFirstExecBegin.append(self.firstExecBegin)
def getRecordFilename(title,description,begin,channel):
	
	begin_date = strftime("%Y%m%d %H%M", localtime(begin))
	begin_shortdate = strftime("%Y%m%d", localtime(begin))
			
	filename = begin_date + " - " + channel
	if title:
		if config.usage.setup_level.index >= 2: # expert+
			if config.recording.filename_composition.value == "short":
				filename = begin_shortdate + " - " + title
			elif config.recording.filename_composition.value == "long":
				filename += " - " + title + " - " + description
			else:
				filename += " - " + title # standard
		else:
			filename += " - " + title
	
	if config.recording.ascii_filenames.value:
		filename = ASCIItranslit.legacyEncode(filename)

	return filename
Exemple #11
0
    def calculateFilename(self):
        service_name = self.service_ref.getServiceName()
        begin_date = time.strftime("%Y%m%d %H%M", time.localtime(self.begin))

        print "begin_date: ", begin_date
        print "service_name: ", service_name
        print "name:", self.name
        print "description: ", self.description

        filename = begin_date + " - " + service_name
        if self.name:
            filename += " - " + self.name

        if config.recording.ascii_filenames.value:
            filename = ASCIItranslit.legacyEncode(filename)

        if self.dirname and not Directories.fileExists(self.dirname, "w"):
            self.dirnameHadToFallback = True
            self.Filename = Directories.getRecordingFilename(filename, None)
        else:
            self.Filename = Directories.getRecordingFilename(filename, self.dirname)
        self.log(0, "Filename calculated as: '%s'" % self.Filename)
	def calculateFilename(self, name=None):
		service_name = self.service_ref.getServiceName()
		begin_date = strftime("%Y%m%d %H%M", localtime(self.begin))

		name = name or self.name
		filename = begin_date + " - " + service_name
		if name:
			if config.recording.filename_composition.value == "event":
				filename = name + ' - ' + begin_date + "_" + service_name
			elif config.recording.filename_composition.value == "short":
				filename = strftime("%Y%m%d", localtime(self.begin)) + " - " + name
			elif config.recording.filename_composition.value == "long":
				filename += " - " + name + " - " + self.description
			else:
				filename += " - " + name # standard

		if config.recording.ascii_filenames.value:
			filename = ASCIItranslit.legacyEncode(filename)

		self.Filename = Directories.getRecordingFilename(filename, self.MountPath)
		self.log(0, "Filename calculated as: '%s'" % self.Filename)
		return self.Filename
Exemple #13
0
    def calculateFilename(self):
        service_name = self.service_ref.getServiceName()
        begin_date = time.strftime("%Y%m%d %H%M", time.localtime(self.begin))

        print "begin_date: ", begin_date
        print "service_name: ", service_name
        print "name:", self.name
        print "description: ", self.description

        filename = begin_date + " - " + service_name
        if self.name:
            filename += " - " + self.name

        if config.recording.ascii_filenames.value:
            filename = ASCIItranslit.legacyEncode(filename)

        if self.dirname and not Directories.fileExists(self.dirname, 'w'):
            self.dirnameHadToFallback = True
            self.Filename = Directories.getRecordingFilename(filename, None)
        else:
            self.Filename = Directories.getRecordingFilename(
                filename, self.dirname)
        self.log(0, "Filename calculated as: '%s'" % self.Filename)