Skip to content

Commit d6c3a39

Browse files
committed
fix cli auto management
1 parent a555cc4 commit d6c3a39

3 files changed

Lines changed: 24 additions & 9 deletions

File tree

Common/common_app_define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// common application definitions
44
#define APPNAME L"LGTV Companion"
5-
#define APP_VERSION L"5.0.2"
5+
#define APP_VERSION L"5.0.4"
66
#define CONFIG_FILE L"config.json"
77
#define LOG_FILE L"log.txt"
88
#define WINDOW_CLASS_UNIQUE L"YOLOx0x0x0181818"

LGTV Companion Service/companion.cpp

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,30 @@ void Companion::Impl::shutdown(bool stage){
189189
}
190190
void Companion::Impl::enableSession(std::vector<std::string> device_names_or_ids){
191191
for (auto& session : sessions_)
192-
for (auto& name_or_id : device_names_or_ids)
193-
if (tools::tolower(session->device_.name) == tools::tolower(name_or_id) || tools::tolower(session->device_.id) == tools::tolower(name_or_id))
194-
session->device_.enabled = true;
192+
{
193+
if (device_names_or_ids.size() > 0)
194+
{
195+
for (auto& name_or_id : device_names_or_ids)
196+
if (tools::tolower(session->device_.name) == tools::tolower(name_or_id) || tools::tolower(session->device_.id) == tools::tolower(name_or_id))
197+
session->device_.enabled = true;
198+
}
199+
else
200+
session->device_.enabled = true;
201+
}
195202
}
196203
void Companion::Impl::disableSession(std::vector<std::string> device_names_or_ids){
197204
for (auto& session : sessions_)
198-
for (auto& name_or_id : device_names_or_ids)
199-
if (tools::tolower(session->device_.name) == tools::tolower(name_or_id) || tools::tolower(session->device_.id) == tools::tolower(name_or_id))
200-
session->device_.enabled = false;
205+
{
206+
if(device_names_or_ids.size() > 0)
207+
{
208+
for (auto& name_or_id : device_names_or_ids)
209+
if (tools::tolower(session->device_.name) == tools::tolower(name_or_id) || tools::tolower(session->device_.id) == tools::tolower(name_or_id))
210+
session->device_.enabled = false;
211+
}
212+
else
213+
session->device_.enabled = false;
214+
215+
}
201216
}
202217
std::string Companion::Impl::setTopology(std::vector<std::string> device_names_or_ids){
203218
if (sessions_.size() == 0)

LGTV Companion Setup/Product.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!-- When publishing updated version, make sure to update "ProductCode" GUID and "Version" -->
22
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui" >
33
<Package Name="LGTV Companion" Language="1033"
4-
Version="5.0.2" Manufacturer="J Persson" UpgradeCode="0BA17E5B-11CE-491D-B1A1-05DD2D9F610A" InstallerVersion="500"
5-
ProductCode="{7EE324BD-17FC-4EF6-BE6C-DFCB5BE3313C}">
4+
Version="5.0.4" Manufacturer="J Persson" UpgradeCode="0BA17E5B-11CE-491D-B1A1-05DD2D9F610A" InstallerVersion="500"
5+
ProductCode="{074EE5D8-3952-4DC8-A78A-A1D739FAE3A0}">
66
<SummaryInformation Description="LGTV Companion installer" />
77
<Media Id="1" Cabinet="LGTVapp.cab" EmbedCab="yes" />
88
<MajorUpgrade DowngradeErrorMessage="A newer version of LGTV Companion is already installed." />

0 commit comments

Comments
 (0)