Recorded file name has wrong episode number (1 Viewer)

Doron

MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    TV-Server Version:
    MediaPortal Version: 1.0 RC2 mediaportal-svn-09-06-2008--11-16-Rev20143
    MediaPortal Skin:
    Windows Version: XP Home
    CPU Type:
    HDD:
    Memory:
    Motherboard:
    Video Card:
    Video Card Driver:
    Sound Card:
    Sound Card AC3:
    Sound Card Driver:
    1. TV Card: ATI AIW 8500DV
    1. TV Card Type: analog
    1. TV Card Driver:
    2. TV Card: Hauppauge 150 MCE
    2. TV Card Type: analog
    2. TV Card Driver:
    3. TV Card:
    3. TV Card Type:
    3. TV Card Driver:
    4. TV Card:
    4. TV Card Type:
    4. TV Card Driver:
    MPEG2 Video Codec:
    MPEG2 Audio Codec:
    h.264 Video Codec:
    Satelite/CableTV Provider:
    HTPC Case:
    Cooling:
    Power Supply:
    Remote:
    TV:
    TV - HTPC Connection:


    I set recording of 3 programs, to be recorded evry day at the same time.
    In all of them, the names of the mpg and xml files always get an episode number which is higher by 1 than the correct number.
    The program info inside the recording's xml file is of the correct episode.


    For example,
    I attached the file "צעירים חסרי מנוח - 4573 - 2008-09-14 - 17_30.xml". The name is in Hebrew, but it means "Young and Restless episode 4573".
    Inside the file you can see the correct textual information, which means "episode 4572".
    The information in my tvguide.xml, also seems correct and points to episode 4572:

    <programme start="20080914173000 +0300" stop="20080914181000 +0300" channel="hot3">
    <title lang="he_IL">צעירים חסרי מנוח</title>
    <sub-title lang="he_IL">The Young and the Restless - *פרק 4572</sub-title>
    <desc lang="he_IL">אופרת סבון. פרק 4572: ג'ק עולה להעיד נגד ויקטור ומשתמש בכול האמצעים כדי להטות את דעת השופט. אשלי יוצאת מהמקום נסערת במהלך עדותו של ג'ק; ג'יי.טי פוגש את קווין בבית הקפה ומטיף לו על אופן ההתנהלות שלו.</desc>
    <category lang="he_IL">סדרה,אופרת סבון</category>
    <episode-num system="onscreen">4572</episode-num>
    </programme>
     

    Attachments

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    Is it only me? Is everyone else's episode numbers are correct?

    Maybe this may spread some light on my case -
    Initialy all series episodes were given names as if they were movies. To make them use the episode number, I copied the name setting in TvServer configuration from series to movies :
    %title% - %channel%\%title% - %episode% - %date% - %start%
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    Source code of the bug

    Ok, I think I have found the bug in the source code. The episode number is clearly being added 1. Maybe there was a reason for doing this, but that reason is probably relevent just in some cases.

    It is in file XMLTVImport.cs. In both cases below, you can see return Convert.ToString(epnum + 1).

    Code:
       string CorrectEpisodeNum(string episodenum)
        {
          if(episodenum == "")
            return episodenum;
    
          // Find format of the episode number
          int slashpos = episodenum.IndexOf("/", 0);
          if (slashpos == -1)
          {
            // No slash found => assume it's just a plain number
            try
            {
              int epnum = Convert.ToInt32(episodenum);
              return Convert.ToString(epnum + 1);
            }
            catch (Exception)
            {
              Log.WriteFile("XMLTVImport::CorrectEpisodeNum, could not parse '{0}' as plain number", episodenum);
            }
          }
          else
          {
            try
            {
              // Slash found -> assume it's formatted as <episode number>/<episodes>
              int epnum = Convert.ToInt32(episodenum.Substring(0, slashpos));
              int epcount = Convert.ToInt32(episodenum.Substring(slashpos + 1));
              return Convert.ToString(epnum + 1) + "/" + Convert.ToString(epcount);
            }
            catch (Exception)
            {
              Log.WriteFile("XMLTVImport::CorrectEpisodeNum, could not parse '{0}' as episode/episodes", episodenum);
            }
          }
          return "";
        }
    And CorrectEpisodeNum() is always being called, in the import function:
    (I don't know why the example says 'Episode #FFEE'. The number with 'onscreen' can be just '5'.)

    Code:
                          else if (nodeEpisodeNumSystem == "onscreen")
                          {
                            // example: 'Episode #FFEE' 
                            serEpNum = ConvertHTMLToAnsi(nodeEpisodeNum);
                            int num1 = serEpNum.IndexOf("#", 0);
                            if (num1 < 0) num1 = 0;
                            episodeNum = CorrectEpisodeNum(serEpNum.Substring(num1, serEpNum.Length - num1));
                          }
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    Thanks, but I must disagree.
    First of all practically I do get this problem. All recorded episode numbers are higher by 1.
    Second, I see tvguide.xml files, and the episode numbers for "onscreen" are not zero-based in those files.
    Last, because the meaning of "onscreen" is "the way it is displayed on screen".
    I see what you meant in the link that you sent. But it is about the "xmltv_ns" system, not about "onscreen".
    Regarding "onscreen" it says clearly:
    The other predefined system, onscreen, is to simply copy what the programme makers write in the credits

    Thanks again.
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    Who can fix this?

    This fix would be simply to remove 2 lines of calling CorrectEpisodeNum() for the 2 cases which are not "xmltv_ns".
    NephilimDM, are you authorized to do that?
     

    Doron

    MP Donator
  • Premium Supporter
  • February 11, 2006
    206
    12
    Nahariya
    Israel Israel
    Hello? Is there any programmer out there? It is a small fix. Can you do it please?
     

    Seidelin

    Retired Team Member
  • Premium Supporter
  • August 14, 2006
    1,755
    652
    Kgs. Lyngby
    Denmark Denmark
    Country flag
    I will try to get this bugfix implemented. Not sure it will make it into RC3 though.

    I added this bug to mantis. Thanks for a good bug report and possible solution.
     

    Broceliande

    Retired Team Member
  • Premium Supporter
  • April 26, 2006
    186
    2
    This fix would be simply to remove 2 lines of calling CorrectEpisodeNum() for the 2 cases which are not "xmltv_ns".
    NephilimDM, are you authorized to do that?

    Hi Doron , it looks like the issue you described was a bit forgotten, though it's in mantis.

    I agree with your arguements, only xmltv_ns should be 0 based.
    onscreen shouldn't.
    However i haven't check webepg's code since a pretty while and am not fully sure of the format james used. As far as i can remember episodes nums weren't decreased after they were parsed on web pages. So webepg users should have encountered the very same troubles than you did.

    Removing the calls of CorrectEpisodeNum(), when node system type differs <> xmltv_ns , is not the best way though.
    CorrectEpisodeNum() also does some parsing/conversion stuff on the nums. I don't wanna add redondant code so i guess i'll tune the method itself, by adding and extra parameter with the system used.

    This should be in next weekly release , if i found some free testers in the team to check the changes and may try with some different xmltv files.

    In any case we will fix it.

    Edit : just added a 'must be fixed" dll if you wanna test, just stop both tvservice/tvsetup bef4

    Thanx for your report,
    Eric
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    Golf4 TV-Records werden als Audio-Files importiert ? Allgemeines Support- und Diskussionsforum 0
    C How do I get MediaPortal to separate recording files by channel and month? General 2
    M partially watched video/song/recorded tv show file text color + remember cursor in folders other features (of release or svn versions) 28
    C TS Recorded TV File Not Updating General 0
    M Recording problems. No files General 9
    toricred Recordings Change : to _ in Series Name General 0
    P Recording films that have an "intermission" General 2
    H MP2 database won't keep in synch with recordings General 4
    toricred Only Show Actual Recordings General 1
    ajs How recreate Recording thumbs TV-Server 4
    P [solved] MP2 new install, 2 x hdhomerun tuners, client on same PC unable to view TV & recordings Newcomers Forum 8
    CyberSimian [Proposal] Tool to display time of next recording MediaPortal 1 0
    R [solved] Unable to delete single recording General 2
    R Correct setting for recordings on shared folder General 0
    W [solved] MP suddenly Crashes when starting live TV on most channels and on recordings from the same channels General Support 20
    W [solved] MP suddenly Crashes when starting live TV on some channels and on some recordings Television (MyTV frontend and TV-Server) 1
    S Shortcuts MP1 My Recorded & TV Guide General 10
    F How to reset tv recordings database General 5
    P Recordings not showing up unless re-imported and not possible to delete General 0
    X Recording import hängt Allgemeines Support- und Diskussionsforum 0
    F Recording starts at second time only MediaPortal 1 Talk 6
    T TV Recording Schedule General 2
    T Unwanted recording Newcomers Forum 18
    bta489 [solved] DVB-T2 Recordings: Sometimes no Audio after muxing with mkvmerge Tools and other software 2
    N Play a TV recording needs a double selection - twice ok on remote Television (MyTV frontend and TV-Server) 2
    Similar threads

























    Top Bottom