Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set backend position for channel groups #921

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="22.3.1"
version="22.4.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 @@
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

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