| 52 | // check flag change playlist |
| 53 | MSqlQuery query(MSqlQuery::InitCon()); |
| 54 | query.prepare("SELECT data FROM settings WHERE value='iptv_playlist_change'"); |
| 55 | if (!query.exec() || !query.isActive()) |
| 56 | MythDB::DBError("fetching flag playlist change", query); |
| 57 | |
| 58 | query.next(); |
| 59 | int flag=query.value(0).toInt(); |
| 60 | query.finish(); |
| 61 | |
| 62 | if ( flag ) |
| 63 | { |
| 64 | m_freeboxchannels.clear(); |
| 65 | query.prepare("UPDATE settings SET data='0' WHERE value='iptv_playlist_change'"); |
| 66 | query.exec(); |
| 67 | query.finish(); |
| 68 | } |
| 69 | |
56 | | m_freeboxchannels = IPTVChannelFetcher::ParsePlaylist(content); |
| 74 | if (content == "internal") |
| 75 | { |
| 76 | //MSqlQuery query(MSqlQuery::InitCon()); |
| 77 | query.prepare("SELECT i.sourceid FROM capturecard AS c,cardinput AS i " |
| 78 | "WHERE c.cardtype='FREEBOX' AND c.videodevice LIKE 'internal:%' " |
| 79 | "AND c.cardid=i.cardid GROUP BY 1"); |
| 80 | if (!query.exec() || !query.isActive()) return false; |
| 81 | query.next(); |
| 82 | int sourceid=query.value(0).toInt(); |
| 83 | query.finish(); |
| 84 | |
| 85 | query.prepare("SELECT channum,name,freqid,xmltvid FROM channel WHERE sourceid = :SOURCEID"); |
| 86 | query.bindValue(":SOURCEID", sourceid); |
| 87 | |
| 88 | if (!query.exec() || !query.isActive()) |
| 89 | { |
| 90 | MythDB::DBError("fetching chaninfo from database", query); |
| 91 | VERBOSE(VB_IMPORTANT, "Can`t fetching chaninfo from database"); |
| 92 | return false; |
| 93 | } |
| 94 | |
| 95 | fbox_chan_map_t chanmap; |
| 96 | |
| 97 | while (query.next()) |
| 98 | { |
| 99 | chanmap[query.value(0).toString()]=IPTVChannelInfo(query.value(1).toString(), query.value(2).toString(), query.value(3).toString()); |
| 100 | } |
| 101 | query.finish(); |
| 102 | |
| 103 | m_freeboxchannels = chanmap; |
| 104 | } |
| 105 | else |
| 106 | { |
| 107 | m_freeboxchannels = IPTVChannelFetcher::ParsePlaylist(content); |
| 108 | } |
| 109 | |