EPG Genre Mapping (1 Viewer)

gonzo90017

Portal Pro
September 3, 2012
238
26
27
Home Country
United States of America United States of America
Unfortunately Mediaportal only reads the first category in tvguide.xml even when more are present:
Code:
<programme start="20140104090000 -0800" stop="20140104113000 -0800" channel="I11.2.230146009.microsoft.com">
        <title lang="en">FA Cup Soccer *</title>
        <sub-title lang="en">Arsenal FC vs. Tottenham Hotspur FC</sub-title>
        <desc lang="en">From Emirates Stadium in London, England.</desc>
        <date>20140104</date>
        <category lang="en">General</category>
        <category lang="en">Other</category>
        <category lang="en">Series</category>
        <category lang="en">Soccer</category>
        <category lang="en">Sports</category>
        <episode-num system="ms_progid">1.296186896</episode-num>
        <episode-num system="onscreen">448</episode-num>
        <audio>
            <stereo>stereo</stereo>
        </audio>
        <new />
        <subtitles type="teletext" />
    </programme>

In this example Soccer and Sports are last on the list so they don't even appear in the EPG Genre Map:
2pp0i8l.jpg


So I was thinking if there is any way to edit tvguide.xml to remove the unwanted categories.
<category lang="en">General</category>
<category lang="en">Other</category>
<category lang="en">Series</category>

This way I would remove all categories except the ones I use. Which are usually just a few: Movies, Sports, News, Children.

By the way this is also an issue with Movies:
Code:
<programme start="20140103010000 -0800" stop="20140103023000 -0800" channel="I4.2.41828011.microsoft.com">
        <title lang="en">The Little Shop of Horrors</title>
        <desc lang="en">Roger Corman's cult classic about a flower shop employee who boosts business when he cultivates a man-eating plant.</desc>
        <credits>
            <director>Roger Corman</director>
            <actor>Jonathan Haze</actor>
            <actor>Jackie Joseph</actor>
            <actor>Mel Welles</actor>
            <actor>Jack Nicholson</actor>
            <actor>Dick Miller</actor>
            <actor>Myrtle Vail</actor>
            <actor>Leola Wendorff</actor>
            <actor>Charles B. Griffith</actor>
            <actor>John Shaner</actor>
            <actor>Meri Welles</actor>
            <producer>Roger Corman</producer>
        </credits>
        <date>1960</date>
        <category lang="en">Comedy</category>
        <category lang="en">General</category>
        <category lang="en">Movies</category>
        <icon src="http://images.windowsmedia.com/dvdcover/cov150/drv600/v625/v62510nrtat.jpg" />
        <episode-num system="ms_progid">1.28433241</episode-num>
        <subtitles type="teletext" />
        <rating system="VCHIP">
            <value>TV-PG</value>
        </rating>
        <rating system="MPAA">
            <value>NR</value>
        </rating>
        <star-rating>
            <value>3/4</value>
        </star-rating>
    </programme>

As you can see Movies is the last category so it also doesn't show up in the EPG Genre map:
9jnfox.jpg
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,544
    8,236
    Home Country
    New Zealand New Zealand
    Nobody has this issue?
    I wouldn't say nobody has this issue, but the way I read your thread it sounds like you're asking for people to suggest a solution. Short of writing your own XMLTV file processor or changing the TV Server code I can't think of any solution. TV Server is under code freeze at the moment, so...
     

    gonzo90017

    Portal Pro
    September 3, 2012
    238
    26
    27
    Home Country
    United States of America United States of America
    I should have asked: Nobody has a solution?

    Anyways is having MediaPortal read all the category/genre information on the road map?
     

    RonD

    Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    So I was thinking if there is any way to edit tvguide.xml to remove the unwanted categories.

    To answer the original question, you can use any text mangling/modifying scripting language you feel comfortable using to modify tvguide.xml file.

    During Saturday's NFL playoffs I wrote the attached quick/dirty vbs script. For "Sports" I added special cases for a number of Sports like Football, Basketball, etc. You can add more sports by tweaking the script. For movies I forced Movies to have priority over Drama, Action, etc. This works for my purposes, but I'm not 100% happy with how it handles Movies, Sports. I'd like to find a way to auto-detect different sub-categories so you don't need to tweak the script to add new sports and think about a better way to handle Movies. Not sure when I'll find time/energy to look into these enhancements. The script takes about 30 seconds to run on a 3 GHz i5-3450 system for a 34 MB tvguide.xml file with 122 channels, 53604 programs.

    To run the vbs script I use a the following modified mc2xml.bat file. My TV Server has all the mc2xml files in my L: Drive in a "\MePo\xmltv" folder. You'll need to modify the Drive letter and paths to match your folders. The batch files has mc2xml write to the default mc2xml.xml, run the vbs script, then copy the output to tvguide.xml. I uploaded the getcat.vbs as getcat.txt, modify the extension to "vbs" to use the script.

    EDIT: Jan 13-14, 2014
    Uploaded a new getcat.txt file that should fix the character mapping error problems. You also need to modify the mc2xml.bat file use the new getcat.vbs script. Also added Soccer and Golf as categories. Fixed file create/update problem in vbs script.

    If you want to set category priority you can add more categories to the vbs script. Look for the comment that starts with "check if saved = "good" catergory" bear the end. Add more IfElse as needed, highest priority are at the start of the "ifs".

    *** start of batch file to run getcat.vbs
    L:
    cd "\MePo\xmltv"
    mc2xml.exe
    cscript //NoLogo getcat.vbs L:\MePo\xmltv\xmltv.xml L:\MePo\xmltv\xmltvtmp.xml
    copy /Y L:\MePo\xmltv\xmltvtmp.xml L:\MePo\xmltv\tvguide.xml
     

    Attachments

    • getcat.txt
      2.2 KB
    Last edited:

    gonzo90017

    Portal Pro
    September 3, 2012
    238
    26
    27
    Home Country
    United States of America United States of America
    Thanks for the reply. This is exactly what I was looking for. However i'm having one little issue. It seems it changes some characters:

    Original .xml
    Code:
    <programme start="20140104145500 -0800" stop="20140104170000 -0800" channel="I34.1.195990666.microsoft.com">
            <title lang="es">Fútbol Mexicano Primera División *</title>
            <sub-title lang="es">Club América vs. Tigres U.A.N.L.</sub-title>
            <desc lang="es">Desde el Estadio Azteca en la Ciudad de México, México.</desc>
            <date>20140104</date>
            <category lang="en">General</category>
            <category lang="en">Other</category>
            <category lang="en">Series</category>
            <category lang="en">Soccer</category>
            <category lang="en">Sports</category>
            <language>es</language>
            <episode-num system="ms_progid">1.296351834</episode-num>
            <episode-num system="onscreen">515</episode-num>
            <video>
                <aspect>16:9</aspect>
                <quality>HDTV</quality>
            </video>
            <new />
            <subtitles type="teletext" />
        </programme>

    Output xml
    Code:
    <programme start="20140104145500 -0800" stop="20140104170000 -0800" channel="I34.1.195990666.microsoft.com">
            <title lang="es">F£tbol Mexicano Primera Divisi¢n *</title>
            <sub-title lang="es">Club Am‚rica vs. Tigres U.A.N.L.</sub-title>
            <desc lang="es">Desde el Estadio Azteca en la Ciudad de M‚xico, M‚xico.</desc>
            <date>20140104</date>
            <category lang="en">Sports</category>
            <language>es</language>
            <episode-num system="ms_progid">1.296351834</episode-num>
            <episode-num system="onscreen">515</episode-num>
            <video>
                <aspect>16:9</aspect>
                <quality>HDTV</quality>
            </video>
            <new />
            <subtitles type="teletext" />
        </programme>

    As you can see it changes the the title from:
    Fútbol Mexicano Primera División
    to
    F£tbol Mexicano Primera Divisi¢n
     

    RonD

    Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    hmm, the script just reads one xml file and writes the other, does not modify the titles or other parts of the data other than skipping some lines with unwanted categories. I guess something is mapping the characters to 8-bit english and swizzles some bits.

    I'll ask the Oracle of Google for options to read/write international characters to see if there is a way to preserve the data. There are local Spanish language stations so I'll check if I see this problem. I'm a mono-lingual English-only guy so I never checked. Hopefully vbs has a simple way to handle international characters.
     

    RonD

    Test Group
  • Team MediaPortal
  • December 20, 2011
    911
    278
    SillyValley CA
    Home Country
    United States of America United States of America
    @gonzo90017

    Try the updated getcat.txt file, this should fix the character mapping problem. When I looked at my script output guide.xml files it had the same problem. I also added Soccer and Golf to the categories, so all soccer games should be <category lang="en">Soccer</category>. You also need to tweak the bat file, remove the ">", and use the MePo genre setup to map Soccer.

    @mm1352000 I did not need to use the TristateTrue format option. I modified the vbs script to open the destination file for write and use "objWrFile.Write strLine & vbCrLf" to do the writes. The vbs script was using "Wscript.Echo strLine" and the batch file did a "> DESTFILE" to write the file. I was using a cmd.exe window for debug and looking at the text output. When I checked the cmd.exe window it had the correct Spanish characters, but somehow the characters are not mapped correctly when the script did the " > DESTFILE". I should have just followed the example I found with google. http://blogs.technet.com/b/heyscrip...e-that-contains-a-specified-string-value.aspx
     

    Users who are viewing this thread

    Top Bottom