Mass Updating Channels Config for External Settops (1 Viewer)

kaliatech

Portal Member
September 28, 2005
26
0
Problem: I'm a DirecTV subscriber with an old settop box. I am not using a serial controller for channels yet, and so I am using USBUIRT (an external IR transmitter). As such, I need to configure all of my MP TVGuide channels to use the external setup top box. Using the current MP configuration GUI, you must do this for each channel. However, even the basic DirecTV subscription has a few hundred channels. Also, unless you setup each channel manually (versus importing them from your XMLTVGuide.xml file), the channel sorting order will be off for various reasons that I'll blame on the Europeans for now. ;)

Caveat: This tip/trick is not well tested, and I'm not an MP expert, but it has saved me a lot of time and seems to work. It is somewhat dependent on your own configuration and at a minimum you need to first determine the id value for your own settup tv capture/input card. My card's id in MP was 250000 for the S-Video input from my Hauppage PVR150MCE. Probably the easiest way for you to determine this id for yourself, is to use the MP configuration.exe to setup one external channel manually, and then use the SQLite Database Browser utility to examine that data for the capture card id. If you don't understand any of the SQL below, you probably shouldn't try doing this. At a minimum, shutdown MP and make a backup copy of the TVDatabaseV21.db3 file first.

Solution: The MP distribution comes with a database utility for viewing/manipulating its internal databases. (MP uses the SQLite3 database.) The utility is named "SQLite Database Browser" and is in the /docs directory. (If not there, it is easily found and downloaded from the Internet.)

The database to be modified: TVDatabaseV21.db3

Prequisites: Everything should be setup and working in MP for you except for the actual channel changing. (You should at least setup a few channels manually for your external display to make sure things are working as expected.) You should have also imported your channels from a valid XMLTVGuide.xml file. This prequisite is very important, and you should make sure that your MP TVGuide display shows the correct information (even if it doesn't change channels correctly and is in the wrong order) before continuing. MP's tvguide import process can take a while to complete and runs in the background (I think?).

Don't forget to change "250000" in the examples below to whatever is appropriate for your setup!

Example Steps:
1) Using the SQL editor in the utility, first run this SQL statement, substituting your capture card ID as appropriate. This statement takes the XMLTVGuide supplied channel number and makes it the external settop channel number.

Code:
UPDATE channel SET [ExternalChannel]=[iChannelNr] WHERE [ExternalChannel] Like 'Unknown' AND [iChannelNr]<250000;
2) This statement tells MP that all of your channel numbers are actually sourced from your TV capture card's input.

Code:
 UPDATE channel SET iChannelNr=250000 WHERE iChannelNr<250000
3) This corrects the channel sort order according to the external channel numbers. (This makes sense to the American/Australian TV users.)

Code:
UPDATE channel SET [iSort]=[ExternalChannel]
4) This simply updates the configuration flag used by MP to indicate that a given channel is from an external settop and that transmit commands should be issued appropriately.

Code:
UPDATE channel SET [bExternal]=1
That should be it. Doing the database manipulation saved me a few hours of tedious setup I think. (If I'm missing something obvious and this wasn't really necessary, PLEASE let me know. ;)) Otherwise, hope it helps someone.
 

mzemina

Retired Team Member
  • Premium Supporter
  • February 23, 2005
    2,065
    14
    Tulsa, OK
    United States of America United States of America
    Can't a (maybe the TV plugin screen) plugin have a button that would actually generate and submit this SQL code?

    Mike
     

    kaliatech

    Portal Member
    September 28, 2005
    26
    0
    Can't a (maybe the TV plugin screen) plugin have a button that would actually generate and submit this SQL code?
    It could... but making it work generically would introduce some complexities. I think at a minimum, the "plugin" would have to allow selection of the input card/channel from a drop-down box.

    I think this type functionality should probably be kept in the scope of utilities (or a fringe plug-in maybe). The "ideal" answer is probably to rework the UI of the TV channels setup. ...but I really don't understand all the issues given that MP functions in many different scenarios for different people. (e.g. Hard for me to understand not having LCN support, and hard for others to understand why some of us want it.)
     

    mzemina

    Retired Team Member
  • Premium Supporter
  • February 23, 2005
    2,065
    14
    Tulsa, OK
    United States of America United States of America
    kaliatech said:
    It could... but making it work generically would introduce some complexities. I think at a minimum, the "plugin" would have to allow selection of the input card/channel from a drop-down box.
    I agree!

    kaliatech said:
    I think this type functionality should probably be kept in the scope of utilities (or a fringe plug-in maybe). The "ideal" answer is probably to rework the UI of the TV channels setup. ...but I really don't understand all the issues given that MP functions in many different scenarios for different people. (e.g. Hard for me to understand not having LCN support, and hard for others to understand why some of us want it.)
    Have you thought about talking with the developers regarding this? I'm not sure which would may have more insight and they maybe heads down trying to get 0.2.0 ready for a real beta release. But I can see that getting this problem solved would really help out quite a number of people. It could be an checkbox option to allow this LCN sorting or leave it as is.

    Mike
     

    gdirwin

    Portal Member
    March 31, 2005
    42
    0
    What SQL commands could be used if I want to add 100's of dummy channels?

    This is to fix the LCN (logical channel numbering) problem. I have 999 channels available in my satellite (starting at 200), so if I want to press 200 on my remote and get channel 200, I have to add 199 dummy/disabled channels.

    If SQL channels are added in this way, does it somehow mess up the tv database indexing with MP?
     

    kaliatech

    Portal Member
    September 28, 2005
    26
    0
    The SQL would be something like this (I didn't test it):

    Code:
    INSERT INTO channels (idChannel, strChannel, iChannelNr, frequency, iSort, {etc columns})
    VALUES (90000, '0dum', 0, 25000, 1, {etc values}) 
    
    INSERT INTO channels (idChannel, strChannel, iChannelNr, frequency, iSort, {etc columns})
    VALUES (90001, '1dum', 1, 25000, 2, {etc values})
    You can get the entire list of column names using the SQLLite browser. I don't know what all the implications are with this workaround or if you should set the Visible field to 0, etc. You might also have to first edit all the existing iSort values so that they start at 100. (UPDATE channels SET iSort=iSort+100). I'm not really sure any more... I kind-of remember a channel sorting capability in the MP UI.
     

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

    OP Similar threads Forum Replies Date
    J Update .NET framework? Improvement Suggestions 0
    G Update von MediaPortal Installationsprobleme? 0
    morpheus_xx [Evaluate] Update to VS 2019? MediaPortal 2 4
    Golf4 Nach Windows-Updates läuft TV-Plugin nicht mehr Allgemeines Support- und Diskussionsforum 0
    B MPEM update list never completes. General Support 0
    JJDoherty Updated DTT frequencies for Ireland... Submit: EPG-Grabbers and tuningdetails 1
    Dark Eyes Updated to Windows 10, now TVServer won't work Installation, configuration support 1
    R [solved] Files moved to new location - Easy way to update database? My TVSeries 7
    M.Hulot Moving Pictures lässt sich nach Windows-Update nicht mehr öffnen Plugins & Erweiterungen 1
    R Files moved to different location - Easy way to update database? Moving Pictures 2
    k12158 [solved] Kein direkter Wechsel von TV-Kanal zu TV-Kanal mehr nach Update? Allgemeines Support- und Diskussionsforum 16
    ajs Mediaportal update to .Net 4.6.2+ MediaPortal 1 13
    Mr6686 [solved] Titan skin broken since update to 1.23 Installation, configuration support 6
    B TV-Server Auto-Update mptvdb after x hours General Support 0
    Terra LAVFilter Plugin cannot be updated (MP1.23) MediaPortal 1 Plugins 10
    TLD Windows 10 1903 feature update General Support 3
    azzuro [Pending] Update MP1 to VisualStudio 2019 MediaPortal 1 36
    A Problem Windows 10 64 bit prof. Update auf Version 1903(gelöst) Installationsprobleme? 0
    T No TV after updating Windows 10 to latest Version 1903 / OS build 18362.175 (logs attached) General Support 2
    M [solved] Updated Swedish translation for MP 1.24 Submit: Localization of MediaPortal and DeployTool 0
    framug 1.22.0 BasicHome Editor settings for DefaultWide HD skin not kept when update 1.22 3
    Neoculture Bulk file name update My TVSeries 6
    HTPCSourcer [Evaluate] MP2-Updates do not remove the GUID of previous installs MediaPortal 2 13
    Rob Hexenmeister [solved] Latests Media Handler - Skinning an updating window or control Fanart Handler 26
    H [solved] Problem bei Update auf 1.21 Installationsprobleme? 4
    Similar threads

























    Top Bottom