Jump to content


Photo

eventname.py and mediaset italian provider


  • Please log in to reply
8 replies to this topic

#1 pinkopallino69

  • Member
  • 30 posts

0
Neutral

Posted 15 September 2012 - 10:23

hello

italian mediaset provider sends on epg annoying message "Visibile gratis su tv terrestre e TivùSat", is it possible to blacklist it in eventname.py?

something like this (got from linsat forum).

from Components.Converter.Converter import Converter
from Components.Element import cached
class EventName(Converter, object):
NAME = 0
SHORT_DESCRIPTION = 1
EXTENDED_DESCRIPTION = 2
ID = 3

def __init__(self, type):
  Converter.__init__(self, type)
  if type == "Description":
   self.type = self.SHORT_DESCRIPTION
  elif type == "ExtendedDescription":
   self.type = self.EXTENDED_DESCRIPTION
  elif type == "ID":
   self.type = self.ID
  else:
   self.type = self.NAME
@cached
def getText(self):
  event = self.source.event
  if event is None:
   return ""
  
  if (event.getEventName())[:31] == "Visibile gratis su tv terrestre":
   return event.getShortDescription().title()
  elif self.type == self.NAME:
   return event.getEventName()
  elif self.type == self.SHORT_DESCRIPTION:
   return event.getShortDescription()
  elif self.type == self.EXTENDED_DESCRIPTION:
   return event.getExtendedDescription()
  elif self.type == self.ID:
   return str(event.getEventId())
 
text = property(getText)


Re: eventname.py and mediaset italian provider #2 pinkopallino69

  • Member
  • 30 posts

0
Neutral

Posted 22 September 2012 - 11:43

According to last openpli version's EventName.py this attached solves partially the problem.
just replacing the .py with this attached.
thanks to linsat forum.

from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.Converter.genre import getGenreStringLong, getGenreStringSub
class EventName(Converter, object):
NAME = 0
SHORT_DESCRIPTION = 1
EXTENDED_DESCRIPTION = 2
FULL_DESCRIPTION = 3
ID = 4
NAME_NOW = 5
NAME_NEXT = 6
GENRE = 7
RATING = 8
SRATING = 9

def __init__(self, type):
  Converter.__init__(self, type)
  if type == "Description":
   self.type = self.SHORT_DESCRIPTION
  elif type == "ExtendedDescription":
   self.type = self.EXTENDED_DESCRIPTION
  elif type == "FullDescription":
   self.type = self.FULL_DESCRIPTION
  elif type == "ID":
   self.type = self.ID
  elif type == "NameNow":
   self.type = self.NAME_NOW
  elif type == "NameNext":
   self.type = self.NAME_NEXT
  elif type == "Genre":
   self.type = self.GENRE
  elif type == "Rating":
   self.type = self.RATING
  elif type == "SmallRating":
   self.type = self.SRATING
  else:
   self.type = self.NAME
@cached
def getText(self):
  event = self.source.event
  if event is None:
   return ""
  
  if self.type == self.NAME:
   if (event.getEventName())[:31] == "Visibile gratis su tv terrestre":
	return event.getShortDescription().title()
   else:
	return event.getEventName()
   return event.getEventName()
  elif self.type == self.SRATING:
   rating = event.getParentalData()
   if rating is None:
	return ""
   else:
	country = rating.getCountryCode()
	age = rating.getRating()
	if age == 0:
	 return _("All ages")
	elif age > 15:
	 return _("bc%s") % age
	else:
	 age += 3
	 return " %d+" % age
  elif self.type == self.RATING:
   rating = event.getParentalData()
   if rating is None:
	return ""
   else:
	country = rating.getCountryCode()
	age = rating.getRating()
	if age == 0:
	 return _("Rating undefined")
	elif age > 15:
	 return _("Rating defined by broadcaster - %d") % age
	else:
	 age += 3
	 return _("Minimum age %d years") % age
  elif self.type == self.GENRE:
   genre = event.getGenreData()
   if genre is None:
	return ""
   else:
	return getGenreStringSub(genre.getLevel1(), genre.getLevel2())
  elif self.type == self.NAME_NOW:
   return pgettext("now/next: 'now' event label", "Now") + ": " + event.getEventName()
  elif self.type == self.NAME_NEXT:
   return pgettext("now/next: 'next' event label", "Next") + ": " + event.getEventName()
  elif self.type == self.SHORT_DESCRIPTION:
   return event.getShortDescription()
  elif self.type == self.EXTENDED_DESCRIPTION:
   return event.getExtendedDescription() or event.getShortDescription()
  elif self.type == self.FULL_DESCRIPTION:
   description = event.getShortDescription()
   extended = event.getExtendedDescription()
   if description and extended:
	description += '\n'
   return description + extended
  elif self.type == self.ID:
   return str(event.getEventId())

text = property(getText)

Edited by pinkopallino69, 22 September 2012 - 11:43.


Re: eventname.py and mediaset italian provider #3 gworld

  • Member
  • 4 posts

0
Neutral

Posted 23 August 2014 - 19:03

someone has solved the problem epg?



Re: eventname.py and mediaset italian provider #4 gworld

  • Member
  • 4 posts

0
Neutral

Posted 24 August 2014 - 14:10

I resolve it!

replace the file EventName.pyo  in /usr/lib/enigma2/python/Components/Converter/

 

:D

Attached Files



Re: eventname.py and mediaset italian provider #5 gworld

  • Member
  • 4 posts

0
Neutral

Posted 5 September 2014 - 13:49

I resolve it!

replace the file EventName.pyo  in /usr/lib/enigma2/python/Components/Converter/

 

:D

the title bar of the channel has been fix, now we need to adjust only the events in the selection of the channel does anyone know which file needs to be changed?



Re: eventname.py and mediaset italian provider #6 avp3

  • Senior Member
  • 32 posts

0
Neutral

Posted 7 March 2015 - 01:30

I think it is channelselection.py.



Re: eventname.py and mediaset italian provider #7 pipor

  • Member
  • 2 posts

0
Neutral

Posted 25 March 2015 - 18:26

sorry for my english but the channel list is still the probleme "Visibile gratis su tv terrestre e TivùSat" is there any way to correct this problem?

2hg4juh.jpg



Re: eventname.py and mediaset italian provider #8 tension

  • Senior Member
  • 116 posts

+4
Neutral

Posted 26 March 2015 - 09:41

If you want to have event short description even in channelselection when event name=fake, do not apply eventname.py patch.

A workaround could be changing the inline method called from everywhere in enigma:

From 0032f84fc4ec44c5e621597668ae658bd0f24579 Mon Sep 17 00:00:00 2001
From: tension <tension9000@yahoo.it>
Date: Sat, 28 Feb 2015 15:21:44 +0100
Subject: [PATCH 1/2] Workaround for fake event title

Return event short description when fake event title
---
 lib/service/event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/service/event.h b/lib/service/event.h
index 73fe200..4bedfd3 100644
--- a/lib/service/event.h
+++ b/lib/service/event.h
@@ -94,7 +94,7 @@ public:
 	time_t getBeginTime() const { return m_begin; }
 	int getDuration() const { return m_duration; }
 	int getEventId() const { return m_event_id; }
-	std::string getEventName() const { return m_event_name; }
+	std::string getEventName() const { return (m_event_name.find("Visibile gratis")==0 ? m_short_description : m_event_name); }
 	std::string getShortDescription() const { return m_short_description; }
 	std::string getExtendedDescription() const { return m_extended_description; }
 	std::string getBeginTimeString() const;
-- 
1.9.1



Re: eventname.py and mediaset italian provider #9 pipor

  • Member
  • 2 posts

0
Neutral

Posted 27 March 2015 - 17:55

 

If you want to have event short description even in channelselection when event name=fake, do not apply eventname.py patch.

A workaround could be changing the inline method called from everywhere in enigma:

From 0032f84fc4ec44c5e621597668ae658bd0f24579 Mon Sep 17 00:00:00 2001
From: tension <tension9000@yahoo.it>
Date: Sat, 28 Feb 2015 15:21:44 +0100
Subject: [PATCH 1/2] Workaround for fake event title

Return event short description when fake event title
---
 lib/service/event.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/service/event.h b/lib/service/event.h
index 73fe200..4bedfd3 100644
--- a/lib/service/event.h
+++ b/lib/service/event.h
@@ -94,7 +94,7 @@ public:
 	time_t getBeginTime() const { return m_begin; }
 	int getDuration() const { return m_duration; }
 	int getEventId() const { return m_event_id; }
-	std::string getEventName() const { return m_event_name; }
+	std::string getEventName() const { return (m_event_name.find("Visibile gratis")==0 ? m_short_description : m_event_name); }
 	std::string getShortDescription() const { return m_short_description; }
 	std::string getExtendedDescription() const { return m_extended_description; }
 	std::string getBeginTimeString() const;
-- 
1.9.1

notepad ++ 

?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users