From 681bdb660ce0cf807c40a8789f8682894c243e8d 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 0d615108e74c2cbf90772003648a6d381ea67af8 Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 4 Nov 2024 10:09:29 +0000 Subject: [PATCH 2/2] changelog and version 22.4.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 7bfd3d934..deb7ef112 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 21f10e055..ff59f4ca8 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,6 @@ +v22.4.0 +- Set backend position for channel groups + v22.3.1 - Take account of whitespace at end of xmltv file while doing format check