From 93b0807ac0cf2a08479b384e97f8abb40cbfea73 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 20 Sep 2013 13:36:42 +0200 Subject: [PATCH] yweb: remove delivery_system from boxtype tank and avoid duplicate code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/99b477207f63e8f755d26969bd162d141f3fe280 Author: vanhofen Date: 2013-09-20 (Fri, 20 Sep 2013) Origin message was: ------------------ - yweb: remove delivery_system from boxtype tank and avoid duplicate code --- .../tuxboxapi/coolstream/controlapi.cpp | 46 +------------------ .../tuxboxapi/coolstream/neutrinoyparser.cpp | 3 +- .../tuxboxapi/coolstream/neutrinoyparser.h | 4 +- src/nhttpd/web/Y_Blocks.txt | 5 +- 4 files changed, 9 insertions(+), 49 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 029416f14..df5fe470d 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -600,55 +600,13 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { - unsigned int system_rev = cs_get_revision(); - std::string boxname = "CST "; + std::string boxname = NeutrinoAPI->NeutrinoYParser->func_get_boxtype(hh, ""); + static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); -#if HAVE_TRIPLEDRAGON - boxname = "Armas "; -#endif - - switch(system_rev) - { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - boxname += "Neo"; - if (CFEManager::getInstance()->getFrontendCount() > 1) - boxname += " Twin"; - break; - case 9: - boxname += "Tank"; - break; - case 10: - boxname += "Zee"; - break; - case 11: - boxname += "Trinity"; - break; - - default: - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - break; - } - - boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; hh->printf("%s\nMAC:%s\n", boxname.c_str(),eth_id.c_str()); - - } //----------------------------------------------------------------------------- void CControlAPI::ShutdownCGI(CyhookHandler *hh) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 8824c9342..85fcde1d1 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -729,7 +729,8 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) break; } - boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; + if (system_rev != 9) // don't add delivery_system for Tank + boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; return boxname; } //------------------------------------------------------------------------- diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h index b32f99c32..6b934c37d 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h @@ -43,7 +43,6 @@ private: std::string func_get_audio_pids_as_dropdown(CyhookHandler *hh, std::string para); std::string func_unmount_get_list(CyhookHandler *hh, std::string para); std::string func_get_partition_list(CyhookHandler *hh, std::string para); - std::string func_get_boxtype(CyhookHandler *hh, std::string para); std::string func_get_current_stream_info(CyhookHandler *hh, std::string para); std::string func_get_timer_list(CyhookHandler *hh, std::string para); std::string func_set_timer_form(CyhookHandler *hh, std::string para); @@ -65,6 +64,9 @@ public: virtual std::string getHookVersion(void) {return std::string("$Revision$");} virtual THandleStatus Hook_SendResponse(CyhookHandler *hh); virtual THandleStatus Hook_ReadConfig(CConfigFile *Config, CStringList &ConfigList); + + // func TUXBOX + std::string func_get_boxtype(CyhookHandler *hh, std::string para); }; #endif /*__nhttpd_neutrinoyparser_h__*/ diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 8ba672987..8c2319421 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -508,13 +508,12 @@ start-block~remote {=if-equal:{=var-get:boxtype=}~CST Zee CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v3=}~ {=if-equal:{=var-get:boxtype=}~CST Neo Twin SAT~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ {=if-equal:{=var-get:boxtype=}~CST Neo Twin CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ - {=if-equal:{=var-get:boxtype=}~CST Tank SAT~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ - {=if-equal:{=var-get:boxtype=}~CST Tank CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ + {=if-equal:{=var-get:boxtype=}~CST Tank~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:boxtype=}~CST Trinity SAT~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=if-equal:{=var-get:boxtype=}~CST Trinity CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=}=}=}=}=}=} + =}=}=}=}=}=}=}=}=} =}=} ~ {=if-equal:{=var-get:yfbtype=}~-2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~