Reply to thread

In lieu of a likely modification to TV Setup module, I have devised my own workaround, using SQL. Here is a quick resume. Should be safe but make sure you have a backup before you try this!


Simple scenario to demonstrate. 2 cards both on A/B diseqc switches. In each case A connects to LNB pointed at Satelite 1, and B to Sat 2. Ticking "Create groups for each satellite", scan card 1 to Satellite 1 only. Similarly scan card 2 to satellite 2 only. After the scan, need to map Sat 2 to card 1 and Sat 1 to card 2. Of course, normally you could just copy the missing channels in such a simple arrangement. But this 'hiding channels' illustration is intended to be extrapolated to a more complex case.


With MP TV Server setup closed, search for MySQL and open link to command line client – default installed with MP. (If you use MS SQL instead you may have to adapt this according to your knowledge of that DB).


Login on with "MediaPortal" (case sensitive)


Connect to database with

[CODE=sql]use mptvdb;[/CODE]


List the groups to get the group IDs

[CODE=sql]select * from channelgroup;[/CODE]


Let's say the groups IDs MP has constructed from your scan are 5 for satellite 1 and 6 for satellite 2.


We now hide all the channels from satellite 1 (Group 5):

[CODE=sql]update channel ch

inner join groupmap gm

on ch.idchannel = gm.idChannel

set ch.isTv = 0x0

where gm.idgroup = 5

;[/CODE]


Leaving the MySQL window open, we now open MP TV Server Setup. It will only show TV channels from satellite 2 because we have temporarily marked the channels from satellite 1 as not TV channels. Map all these channels to Card 1 and close setup.


We can now reset the TV channels:

[CODE=sql]update channel

set isTv = 0x1

where isRadio = 0x0

;[/CODE]


This simply goes through the whole dataset and, wherever a channel is not marked as Radio, marks it as TV. Thus all the previously unmarked TV channels are restored.


Repeat the temporary channel hiding for group 6 (i.e. change the above line WHERE gm.idgroup = 6) which will only show TV channels from Satellite 1 to map to card 2. Remember to reset all channels again before leaving the MySQL command line.


 Of course, this is just a simple illustration done the manual way.  Clearly it can be scripted. I leave it to anyone needing this to make their own arrangements. In a situation with multiple satellites, you would sequentially hide the TV channels for each satellite group until only the ones you want to map remain.  A single reset SQL will then restore status quo for the lot.


Top Bottom