Skip to content

Commit

Permalink
Merge pull request #922 from phunkyfish/group-backend-order-omega
Browse files Browse the repository at this point in the history
Set backend position for channel groups - Omega
  • Loading branch information
phunkyfish authored Nov 4, 2024
2 parents 4665d80 + 65e995c commit 24575be
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pvr.iptvsimple/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.iptvsimple"
version="21.9.4"
version="21.10.0"
name="IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down
3 changes: 3 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/iptvsimple/ChannelGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void ChannelGroups::Clear()
{
m_channelGroups.clear();
m_channelGroupsLoadFailed = false;
m_groupBackendOrderPosition = 0;
}

int ChannelGroups::GetChannelGroupsAmount() const
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions src/iptvsimple/ChannelGroups.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ namespace iptvsimple

bool m_channelGroupsLoadFailed = false;

int m_groupBackendOrderPosition;

std::shared_ptr<iptvsimple::InstanceSettings> m_settings;
};
} //namespace iptvsimple
2 changes: 1 addition & 1 deletion src/iptvsimple/data/ChannelGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 4 additions & 0 deletions src/iptvsimple/data/ChannelGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand All @@ -38,6 +41,7 @@ namespace iptvsimple
private:
bool m_radio;
int m_uniqueId;
int m_position;
std::string m_groupName;
std::vector<int> m_memberChannelIndexes;
};
Expand Down

0 comments on commit 24575be

Please sign in to comment.