Skip to content

Commit

Permalink
Merge pull request #500 from phunkyfish/tvg-rec
Browse files Browse the repository at this point in the history
tvg-rec fix
  • Loading branch information
phunkyfish authored Mar 23, 2021
2 parents a4c4171 + 177daec commit 5369445
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 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="7.5.0"
version="7.5.1"
name="PVR IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down Expand Up @@ -169,6 +169,10 @@
<icon>icon.png</icon>
</assets>
<news>
v7.5.1
- Fixed: Treat 'tvg-rec' catchup tag like the siptv 'timeshift' tag
- Fixed: Ensure channel's catchup window is used instead of value from settings

v7.5.0
- Added: Support sub channel numbers
- Added: Allow setting scope for channels using catchup mode setting to enable overriding
Expand Down
4 changes: 4 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v7.5.1
- Fixed: Treat 'tvg-rec' catchup tag like the siptv 'timeshift' tag
- Fixed: Ensure channel's catchup window is used instead of value from settings

v7.5.0
- Added: Support sub channel numbers
- Added: Allow setting scope for channels using catchup mode setting to enable overriding
Expand Down
6 changes: 3 additions & 3 deletions src/iptvsimple/CatchupController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ void CatchupController::ProcessChannelForPlayback(const Channel& channel, std::m
m_programmeCatchupId.clear();
if (channel.IsCatchupSupported())
{
m_timeshiftBufferOffset = Settings::GetInstance().GetCatchupDaysInSeconds(); //offset from now to start of catchup window
m_timeshiftBufferStartTime = std::time(nullptr) - Settings::GetInstance().GetCatchupDaysInSeconds(); // now - the window size
m_timeshiftBufferOffset = channel.GetCatchupDaysInSeconds(); //offset from now to start of catchup window
m_timeshiftBufferStartTime = std::time(nullptr) - channel.GetCatchupDaysInSeconds(); // now - the window size
}
else
{
Expand Down Expand Up @@ -107,7 +107,7 @@ void CatchupController::ProcessEPGTagForTimeshiftedPlayback(const kodi::addon::P

time_t timeNow = time(0);
time_t programmeOffset = timeNow - m_catchupStartTime;
time_t timeshiftBufferDuration = std::max(programmeOffset, Settings::GetInstance().GetCatchupDaysInSeconds());
time_t timeshiftBufferDuration = std::max(programmeOffset, static_cast<time_t>(channel.GetCatchupDaysInSeconds()));
m_timeshiftBufferStartTime = timeNow - timeshiftBufferDuration;
m_catchupStartTime = m_timeshiftBufferStartTime;
m_catchupEndTime = timeNow;
Expand Down
6 changes: 4 additions & 2 deletions src/iptvsimple/PlaylistLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,12 @@ std::string PlaylistLoader::ParseIntoChannel(const std::string& line, Channel& c
int siptvTimeshiftDays = 0;
if (!strCatchupSiptv.empty())
siptvTimeshiftDays = atoi(strCatchupSiptv.c_str());
// treat tvg-rec tag like siptv if siptv has not been used
if (!strTvgRec.empty() && siptvTimeshiftDays == 0)
siptvTimeshiftDays = atoi(strTvgRec.c_str());

if (!strCatchupDays.empty())
channel.SetCatchupDays(atoi(strCatchupDays.c_str()));
else if (!strTvgRec.empty())
channel.SetCatchupDays(atoi(strTvgRec.c_str()));
else if (channel.GetCatchupMode() == CatchupMode::VOD)
channel.SetCatchupDays(IGNORE_CATCHUP_DAYS);
else if (siptvTimeshiftDays > 0)
Expand Down

0 comments on commit 5369445

Please sign in to comment.