From 2e3b41b66ffdebc948a77c827adba4fd13f70e28 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 4 Nov 2024 10:07:50 +0000 Subject: [PATCH 1/2] Set backend position for channel groups --- src/iptvsimple/ChannelGroups.cpp | 2 ++ src/iptvsimple/ChannelGroups.h | 2 ++ src/iptvsimple/data/ChannelGroup.cpp | 2 +- src/iptvsimple/data/ChannelGroup.h | 4 ++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/iptvsimple/ChannelGroups.cpp b/src/iptvsimple/ChannelGroups.cpp index 094bb1760..70e768729 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 ba9c560a3..89dd2d833 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 2bc0ffeca..a570ce52a 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 430bfcbca..3be6cec40 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; }; From 65e995c0fd5a9483443dfc915c65d8ff8c1fc9c8 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 4 Nov 2024 10:11:13 +0000 Subject: [PATCH 2/2] changelog and version 21.10.0 --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 208a69c2f..382c19e9a 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 9b2724181..6f24f8222 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