EPG/Scheduler case sensitive (1 Viewer)

fstruijs

MP Donator
  • Premium Supporter
  • January 20, 2009
    26
    1
    Breda
    Home Country
    Netherlands Netherlands
    Hello,

    Recently I have noticed that sometimes TV programs are not recorded because the EPG does not consistently use uppercase or lowercase characters in the program name. Is it possible to make the scheduler in MediaPortal not case sensitive?

    Kind regards,
    Frank
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    Hello,

    Recently I have noticed that sometimes TV programs are not recorded because the EPG does not consistently use uppercase or lowercase characters in the program name. Is it possible to make the scheduler in MediaPortal not case sensitive?

    Kind regards,
    Frank
    @morpheus_xx is that possible?
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Recently I have noticed that sometimes TV programs are not recorded because the EPG does not consistently use uppercase or lowercase characters in the program name. Is it possible to make the scheduler in MediaPortal not case sensitive?
    Can you please explain this a bit further? What kind of schedule did you add? What was the original title, what the wrong cased one?

    SQLite does support NOCASE collation, but it seems to work only with ASCII characters. See here for issues with France words How to set Sqlite3 to be case insensitive when string comparing?.

    For the main MP2 database we use our own collation (like here), which does in principle use C# method to do comparing and sorting. But IIRC it has to be registered before the actual tables are created.
     

    fstruijs

    MP Donator
  • Premium Supporter
  • January 20, 2009
    26
    1
    Breda
    Home Country
    Netherlands Netherlands
    Hi,

    I added a recurring recording schedule from the TV Guide in MP2.

    While adding the recording, I choose the option "record every time on this channel".

    Sometimes, MP2 doesn't record a program because in the TV-Guide (EPG) a lowercase character has been replaced by an uppercase (or the other way around). The provider (who delivers the EPG) is not consistently using exactly the same name for the program.

    For example, I create a recurring recording for "Wheeler Dealers" on Discovery channel. That works fine, until Ziggo, my TV provider, decides to announce the program in the EPG as "Wheeler dealers".

    As a workaround, I create a second recording (see attachments, screen copy from Schedules in the setup tool), but I think this should not be happening.

    Regards,
    Frank
     

    Attachments

    • Capture1.JPG
      Capture1.JPG
      13.1 KB
    • Capture2.JPG
      Capture2.JPG
      13.1 KB
    • Capture3.JPG
      Capture3.JPG
      12.9 KB
    Last edited:

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    Recently I have noticed that sometimes TV programs are not recorded because the EPG does not consistently use uppercase or lowercase characters in the program name
    Can you please explain this a bit further?
    I recollect this being a problem years ago, when I first started using MP (2014). But I have not noticed it as a problem in recent years (with MP1). However...

    Tonight I scheduled to record a weekly programme that showed precisely this problem. Look at the screen shot below. It is the "Upcoming Episodes" panel in MP1, and if you look closely you will see that lines 1 and 2 in the list spell the title differently from lines 3 and 4 -- the spelling of "the" differs:

    upcoming_episodes.jpg

    However, when TV Server searched the EPG in order to generate the list of upcoming episodes, it clearly did so using a case-insensitive comparison (so it found both spellings of the title). But now look at the red dot at the end of line 1. I scheduled this recording as "weekly on this day of the week", so line 3 should also have a red dot, but it does not. So does this mean that TV Server has failed to schedule the episode with the different spelling? No. :eek:

    Look at the following two screen shots. The one on the left shows the EPG for today, and the screen shot on the right shows the EPG for 7 days from now. Notice that the programme that I scheduled is displayed in red in both screen shots. This indicates that both episodes are scheduled to record:

    epg_today.jpg epg_7_days_ahead.jpg

    So, my conclusion is that in MP1 the only error is that on the "Upcoming Episodes" panel TV Server does not flag correctly the episodes that are scheduled to record -- line 3 is missing the red dot. But the episodes will nevertheless record correctly.

    If MP2 does not record these differently spelled episodes, possibly the MP2 version of TV Server is missing a fix that is present in the MP1 version of TV Server?

    -- from CyberSimian in the UK
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Thanks @fstruijs and @CyberSimian for details.

    @CyberSimian, when you are checking this in MP1, what database is used? Probably MySQL. Can you please check how the "programs" table is defined in regards of default charater set and also used collation? See here for details.

    If MySQL uses case insensitive collation here, this has to be ported over to SQLite as well. This can be done by using the custom functions for sorting as I wrote above. Problem is the way TVE3 in MP2 does create the database: it simply copies over an empty template database if none is present. This means we need to create a new template with custom collation and require users to fully setup the TV part again (maybe doing export/import, but anyway a manual process).

    With TVE3.5/EFCore/(x64) I do no longer need this, it creates a new database from code. So we have more control over this process.
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Hi.
    require users to fully setup the TV part again
    Most likely this can be avoided by using SQL commands (simple batch script probably running after installation or with a SQLite GUI) on the database. Something like "Alter Column"
    Example from here:
    SQL:
    ALTER TABLE dbo.MyTable
    ALTER COLUMN CharCol VARCHAR(50) COLLATE Latin1_General_100_CI_AI_SC_UTF8

    I yet don't know exactly what to do but I'm sure I would find something and not redo the whole TV database for this...
     

    fstruijs

    MP Donator
  • Premium Supporter
  • January 20, 2009
    26
    1
    Breda
    Home Country
    Netherlands Netherlands
    Gents,

    Thanks for your help.

    Is there anything I can do? Testing, implementing workaround, reproducing, providing logging, etc ...?

    Regards,
    Frank
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    Can you please check how the "programs" table is defined in regards of default charater set and also used collation?
    Firstly, I know nothing about SQL :eek:. However, I have previously downloaded the MP source code and unzipped it. Looking at that, I have this folder:

    D:\mpsrc\1_25f\MediaPortal-1-master\TvEngine3\TVLibrary\SetupTv

    This folder contains various SQL files, one of which is "create_mysql_database.sql". Looking in that, I find a definition for the "Program" table, namely this one:

    Code:
    --
    -- Definition of table "Program"
    --
    CREATE TABLE "Program" (
      "idProgram" int(11) NOT NULL auto_increment,
      "idChannel" int(11) NOT NULL,
      "startTime" datetime NOT NULL,
      "endTime" datetime NOT NULL,
      "title" varchar(2000) NOT NULL,
      "description" text NOT NULL,
      "seriesNum" varchar(200) NOT NULL,
      "episodeNum" varchar(200) NOT NULL,
      "genre" varchar(200) NOT NULL,
      "originalAirDate" datetime NOT NULL,
      "classification" varchar(200) NOT NULL,
      "starRating" int(11) NOT NULL,
      "notify" bit(1) NOT NULL,
      "parentalRating" int(11) NOT NULL,
      PRIMARY KEY  ("idProgram"),
      UNIQUE KEY "idProgramBeginEnd" ("idChannel","startTime","endTime")
    ) ENGINE=INNODB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
    #


    So CHARSET is specified , but COLLATE is not. I searched the entire file to see if COLLATE was specified anywhere (I searched for the string "collat"). There are several occurrences, but they look to me as though they are commented out, as they occur within /* */ pairs (are those comment delimiters in SQL?).

    -- from CyberSimian in the UK
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Hi.

    Most likely this can be avoided by using SQL commands (simple batch script probably running after installation or with a SQLite GUI) on the database. Something like "Alter Column"
    Example from here:
    SQL:
    ALTER TABLE dbo.MyTable
    ALTER COLUMN CharCol VARCHAR(50) COLLATE Latin1_General_100_CI_AI_SC_UTF8

    I yet don't know exactly what to do but I'm sure I would find something and not redo the whole TV database for this...
    Yes this is usually the way to go. But unfortunately this is not supported in SQLite. You have to do it in multiple steps (rename, add, update, drop).

    Is there anything I can do? Testing, implementing workaround, reproducing, providing logging, etc ...?
    Can you zip and upload your database file here? It's stored as: C:\ProgramData\Team MediaPortal\MP2-Server\Database\MP2TVE_3.s3db.

    I will try to do the changes manually to Programs table only.
     

    Users who are viewing this thread

    Top Bottom