diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 208a69c2..382c19e9 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 9b272418..6f24f822 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v21.10.0 +- Set backend position for channel groups + v21.9.4 - Take account of whitespace at end of xmltv file while doing format check diff --git a/src/iptvsimple/ChannelGroups.cpp b/src/iptvsimple/ChannelGroups.cpp index 094bb176..70e76872 100644 --- a/src/iptvsimple/ChannelGroups.cpp +++ b/src/iptvsimple/ChannelGroups.cpp @@ -27,6 +27,7 @@ void ChannelGroups::Clear() { m_channelGroups.clear(); m_channelGroupsLoadFailed = false; + m_groupBackendOrderPosition = 0; } int ChannelGroups::GetChannelGroupsAmount() const @@ -115,6 +116,7 @@ int ChannelGroups::AddChannelGroup(iptvsimple::data::ChannelGroup& channelGroup) if (!existingChannelGroup) { channelGroup.SetUniqueId(m_channelGroups.size() + 1); + channelGroup.SetPosition(m_groupBackendOrderPosition++); m_channelGroups.emplace_back(channelGroup); diff --git a/src/iptvsimple/ChannelGroups.h b/src/iptvsimple/ChannelGroups.h index ba9c560a..89dd2d83 100644 --- a/src/iptvsimple/ChannelGroups.h +++ b/src/iptvsimple/ChannelGroups.h @@ -44,6 +44,8 @@ namespace iptvsimple bool m_channelGroupsLoadFailed = false; + int m_groupBackendOrderPosition; + std::shared_ptr m_settings; }; } //namespace iptvsimple diff --git a/src/iptvsimple/data/ChannelGroup.cpp b/src/iptvsimple/data/ChannelGroup.cpp index 2bc0ffec..a570ce52 100644 --- a/src/iptvsimple/data/ChannelGroup.cpp +++ b/src/iptvsimple/data/ChannelGroup.cpp @@ -13,6 +13,6 @@ using namespace iptvsimple::data; void ChannelGroup::UpdateTo(kodi::addon::PVRChannelGroup& left) const { left.SetIsRadio(m_radio); - left.SetPosition(0); // groups default order, unused + left.SetPosition(m_position); left.SetGroupName(m_groupName); } diff --git a/src/iptvsimple/data/ChannelGroup.h b/src/iptvsimple/data/ChannelGroup.h index 430bfcbc..3be6cec4 100644 --- a/src/iptvsimple/data/ChannelGroup.h +++ b/src/iptvsimple/data/ChannelGroup.h @@ -25,6 +25,9 @@ namespace iptvsimple int GetUniqueId() const { return m_uniqueId; } void SetUniqueId(int value) { m_uniqueId = value; } + int GetPosition() const { return m_position; } + void SetPosition(int value) { m_position = value; } + const std::string& GetGroupName() const { return m_groupName; } void SetGroupName(const std::string& value) { m_groupName = value; } @@ -38,6 +41,7 @@ namespace iptvsimple private: bool m_radio; int m_uniqueId; + int m_position; std::string m_groupName; std::vector m_memberChannelIndexes; };