[Approved] - Mantis 0002874 Multiline channel titles to display correctly in guides / info windows

Discussion in 'Archive' started by velis, January 28, 2010.

  1. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    I'm trying to do a patch which would fix the following situation:
    If a TV show title is multiline text, the following happens:
    Mini guide: The title is rendered multiline which causes it to render over other items in the list below this program
    EPG guide: Same as above
    Info window: Only the first line of show title is displayed

    So I started out with TVMiniGuide and found the appropriate code which assigns show title to screen labels.

    However I'm not sure this should be the correct way of fixing the problem.
    I think I should rather override the TVChannel.Title so that it would always return a single-line string.
    However I can't find TVChannel.Title. The class declaration is rather cryptic to me (not much C# experience). I'm assuming title is either a property or a member variable of the class which would mean that I would need to fix every assignment to it in order to fix the problem by method #2.

    Can a seasoned developer offer me advice on proper course of action?
    I will proceed on my own after that but as it is, I can only do method #1 - which I'm not sure is the correct method of fixing this in the first place - hence no patch yet.

    Edit: attached the patch


     

    Attached Files:

    • webepg.patch
      File size:
      30.6 KB
      Uploaded:
      April 29, 2010
      Views:
      103
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    Re: Multiline channel titles to display correctly in guides / info windows

    Hmmm, no reply.
    Is this patch not interesting? I can't believe RTV SLO is the only EPG provider in the world that provides multi-line program titles.
     
  4. tourettes
    • Team MediaPortal

    tourettes Retired Team Member

    Joined:
    January 7, 2005
    Messages:
    17,301
    Likes Received:
    4,595
    Ratings:
    +4,810 / 3
    Re: Multiline channel titles to display correctly in guides / info windows

    Moved thread to development section. Patches section should be only used when there is a patch to be provided.

    About the issue, I have no clue about the skinning / skin engine :)
     
  5. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    Re: Multiline channel titles to display correctly in guides / info windows

    OK,

    I seem to have figured out where the titles get assigned.

    I have made two changes:
    1. Fixing up program title and subtitle so that I remove all newlines and double spaces
    2. Removing CDATA tags from program description

    The first change hopefully changes the OP issue
    The second change hopefully fixes the CDATA issue I've been having with some WEBEPG providers (the CDATA tag was displaying alongside other text)

    Honestly, I don't know even if this patch is OK. The CDATA tag should be removed while parsing the XML and not so late. The tag itself means that the data should be parsed byte for byte without any character translations like & etc.
    I have implemented it anyway since I could not find the actuyl XML parsing code and also because it seems the data is imported just fine even without properly parsing the tag.

    Unfortunately I again have some problems testing the patch.
    After considerable agony to make the projects compile (turns out it's simple, one just has to know what to do - compile client project first, TV server project later) I have managed to produce the WebEpg.dll
    However, when replacing the dll from 8.1.2010 SVN build, TV Server configuration reports a version error and fails to load the plugin.

    I hope one of the seasoned developers would be willing to try this patch or to let me know how I can fool the TV server configuration into loading the new webepg.dll.
    The xml configuration for the CDATA provider can be found in this post (rtvslo.xml).

    Attached, naturally, is the modified ProgramData.cs.
     

    Attached Files:

  6. arion_p
    • Team MediaPortal

    arion_p Retired Team Member

    Joined:
    February 7, 2007
    Messages:
    3,352
    Likes Received:
    1,447
    Occupation:
    Developer
    Location:
    Athens
    Ratings:
    +1,522 / 0
    Home Country:
    Greece Greece
    Show System Specs
    Re: Multiline channel titles to display correctly in guides / info windows

    1. Removing new-lines from the text will eliminate any formatting of the text and will make it unreadable. Imagine a situation where the text is separated by new-lines but there is no full stop at the end of each sentence. Removing the new-lines will merge the sentences making them unreadable.

    If the text displays outside of the bounds of a control, then it is a bug in the control. If this is the case please provide more information on how to reproduce this so it can be fixed.

    2. The xml source you have linked is simply formatted wrongly. Below is an excerpt from the xml:
    Code (Text):
    1.     <spored>
    2.         <ura>08:00</ura>
    3.         <naslov>POROČILA </naslov>
    4.         <legenda>S pomočjo teleteksta (stran 777) lahko gluhi in naglušni spremljajo oddaje, saj so govorci podnaslovljeni, tudi kadar govorijo slovensko.</legenda>
    5.         <legenda>Oddajo je mogoče gledati v neposrednem prenosu prek spleta. Za ogled kliknite na avdio/video.</legenda>
    6.         <legenda_sifre>ZA_GLUHE</legenda_sifre>
    7.         <legenda_sifre>V_ZIVO_NA_INTERNETU</legenda_sifre>
    8.         <opis>[COLOR=Red]&lt;![CDATA[]]&gt;[/COLOR]</opis>
    9.         <napovednik>[COLOR=Red]&lt;![CDATA[[/COLOR]Leta 1942, ko se je zgodil preobrat na vzhodni fronti in so v vojno z Nemčijo vstopili tudi Američani, so se v Berlinu na tajnem sestanku zbrali najvišji državni uradniki, vojaški poveljniki, ekonomisti, pravniki in SS-ovski oficirji in razpravljali o "Končni rešitvi judovskega vprašanja". Konferenca je trajala kar nekaj dni, potekala pa je v razkošni Hitlerjevi rezidenci v Wanseeju. O sestankih, ki so bili visoko zaupni, niso vodili zapisnika, vsi udeleženci so bili zavezani k molčečnosti. Pa vendar obstaja tajni zapisnik srečanja.  Film je rekonstrukcija dogajanja na tajni konferenci.[COLOR=Red]]]&gt;[/COLOR]</napovednik>
    10.         <zvrst></zvrst>
    11.         <dolzina_sec>300</dolzina_sec>
    12.         <dolzina>00:5</dolzina>
    13.     </spored>
    14.  
    Notice that instead of using <![CDATA[ it uses &lt;![CDATA[ which the xml parser recognizes as a literal text instead of a CDATA node. The correct xml would have been:
    Code (Text):
    1.     <spored>
    2.         <ura>08:00</ura>
    3.         <naslov>POROČILA </naslov>
    4.         <legenda>S pomočjo teleteksta (stran 777) lahko gluhi in  naglušni spremljajo oddaje, saj so govorci podnaslovljeni, tudi kadar  govorijo slovensko.</legenda>
    5.         <legenda>Oddajo je mogoče gledati v neposrednem prenosu  prek spleta. Za ogled kliknite na avdio/video.</legenda>
    6.         <legenda_sifre>ZA_GLUHE</legenda_sifre>
    7.         <legenda_sifre>V_ZIVO_NA_INTERNETU</legenda_sifre>
    8.         <opis>[COLOR=Red]<![CDATA[]]>[/COLOR]</opis>
    9.         <napovednik>[COLOR=Red]<![CDATA[[/COLOR]Leta 1942, ko se je zgodil  preobrat na vzhodni fronti in so v vojno z Nemčijo vstopili tudi  Američani, so se v Berlinu na tajnem sestanku zbrali najvišji državni  uradniki, vojaški poveljniki, ekonomisti, pravniki in SS-ovski oficirji  in razpravljali o "Končni rešitvi judovskega vprašanja". Konferenca je  trajala kar nekaj dni, potekala pa je v razkošni Hitlerjevi rezidenci v  Wanseeju. O sestankih, ki so bili visoko zaupni, niso vodili zapisnika,  vsi udeleženci so bili zavezani k molčečnosti. Pa vendar obstaja tajni  zapisnik srečanja.  Film je rekonstrukcija dogajanja na tajni  konferenci.[COLOR=Red]]]>[/COLOR]</napovednik>
    10.         <zvrst></zvrst>
    11.         <dolzina_sec>300</dolzina_sec>
    12.         <dolzina>00:5</dolzina>
    13.     </spored>
    14.  
     
  7. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    Re: Multiline channel titles to display correctly in guides / info windows

    XML well-formedness: I guess you grabbed with my grabber because this is the *resulting* XML, not the grabber XML. I guess you would be correct if this is indeed the case. That would mean that our national TV encodes the XML incorrectly. Is there anything that could be done about this? Plugin for WEBEPG that would process resulting data before insertion into the database maybe?

    I will do a print screen of the affected dialogs later, but in short they are as following:
    1. Press <enter> during live TV playback. A list of channels will appear each with it's own currently playing programme. Programme title is displayed multi-line.
    Sample image can be found here (see the last image - "Dialog"). Naturally, this sample image does not contain multi line programme titles and looks fine.

    2. Invoke EPG - ~10 programmes vertically with currently playing and a few hours ahead of shows arranged in rows. This one also has problems with multi line programme titles. Sample image at the above URL (image "EPG")

    3. Info window during live TV playback. The one showing current channel and programme being played. It will only display the first line of multi line programme title.

    I have not tested how such programme titles affect recorded TV Shows, but I'm guessing it's in no way pleasant.
    Basically everywhere programme titles are displayed, they are displayed multi line and thus wrong. That's why I just assumed removing the newlines would do the trick. Also I you haven't noticed, I'm replacing newlines with a space so the sentence should be perfectly readable.
     
  8. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    Re: Multiline channel titles to display correctly in guides / info windows

    Here are the screen shots as promised. Sorry about the delay, I've been pretty busy this week.

    Note that the multi-line drawing is present in Blue3Wide as well. XFace does not change anything in this respect.

    Note the program title for RTV SLO 2.
    Both guides display it over following lines.
    The info window just cuts the text instead of scrolling it (probably also result of one single line being too long).
     

    Attached Files:

    • EPG.jpg
      EPG.jpg
      File size:
      490.6 KB
      Uploaded:
      April 23, 2010
      Views:
      142
    • info_window.jpg
      info_window.jpg
      File size:
      331.3 KB
      Uploaded:
      April 23, 2010
      Views:
      110
    • quick_guide.jpg
      quick_guide.jpg
      File size:
      347.1 KB
      Uploaded:
      April 23, 2010
      Views:
      131
  9. riksmith

    riksmith Portal Pro

    Joined:
    April 18, 2009
    Messages:
    1,856
    Likes Received:
    321
    Gender:
    Male
    Ratings:
    +321 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    Re: Multiline channel titles to display correctly in guides / info windows

    In the first place i find it very strange that the program TITLE would contain newlines, so I think it is not a strange solution to remove new lines from the title. When looking at the GUI i think Mediaportal is not build for multiline titles, and i doubt that it should be adapted to show the titles in multi-line.

    Apart from that, where does that EPG info come from (Edit: found in other thread)? Isn't it possible that it is an EPG bug, for instance using a shortdescription instead of the title?
     
  10. riksmith

    riksmith Portal Pro

    Joined:
    April 18, 2009
    Messages:
    1,856
    Likes Received:
    321
    Gender:
    Male
    Ratings:
    +321 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    Re: Multiline channel titles to display correctly in guides / info windows

    Since i cannot read slovenian i used google to translate the piece of xml, it seems that "naslov" is the title and "opis" the description(however in the example it seems "napovednik" contains the actual description). In this example the title is very short. So is the correct field used?

    I also tried this url manually: http://www.rtvslo.si/modload.php?&c...dan=2010-04-25&izbran_program=1&s_content=xml It does not seem to contain any multiline texts for the title.
     
  11. velis
    • Premium Supporter

    velis MP Donator

    Joined:
    July 16, 2009
    Messages:
    237
    Likes Received:
    25
    Location:
    Radovljica
    Ratings:
    +37 / 0
    Home Country:
    Slovenia Slovenia
    Re: Multiline channel titles to display correctly in guides / info windows

    Yes, you are correct. The translations you got are correct. I too looked at resulting XML and found it curious that "napovednik" (announcer, trailer?) would contain the actual description instead of "opis" (description).

    I have also looked at possible other fields in the XML that would satisfy the need for program titles, but there are none.

    Today I also went searching for a multiline title. I found several candidates, but the XML doesn't contain any new lines. I must check what my MP grabber got for these programmes.

    Some samples I suspect should be multi line in MP:
    18:00, 19:40: http://www.rtvslo.si/modload.php?&c...dan=2010-05-01&izbran_program=2&s_content=xml
    19:55, 21:00: http://www.rtvslo.si/modload.php?&c...dan=2010-04-29&izbran_program=2&s_content=xml

    The times in front of URL are of course show starting times (both days have two likely candidates)

    Note that XML format is also a bit curious:
    in case of short title, you get an XMl tag like this:
    <naslov>SLOVENSKI MAGAZIN, PONOVITEV</naslov>

    in case of a longer title, you get this:
    <naslov>
    BIRMINGHAM: EVROPSKO PRVENSTVO V GIMNASTIKI:
    ORODJA (Ž), VKLJUČITEV V PRENOS&&
    Reporterja: Peter Kavčič in Ivan Čuk
    </naslov>
    (note thet the above is all in one line)

    Will post an edit in the afternoon about my findings.


    Edit:
    Found the possible problem:
    Though FireFox and IE show the resulting XML as one line only, the actual XML encoding of one of the above titles is:
    <naslov>LODZ: ODBOJKA,
    ZAKLJUČNI TURNIR LIGE PRVAKOV:
    ACH VOLLEY BLED - TRENTINO, POLFINALE, PRENOS&amp;&amp;
    Reporter: Marjan Fortin</naslov>

    So there are new lines, but I guess it depends on the parser how it will interpret them. I'm betting this title will be multi-line in MP.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!