[SCM] kodi-pvr-hts/master: Use removal as lifetime for htspv25+
tiber-guest at users.alioth.debian.org
tiber-guest at users.alioth.debian.org
Wed Mar 2 23:01:54 UTC 2016
The following commit has been merged in the master branch:
commit 0377a4fe1476228d0330d38b78d5e4f2e971a4fa
Author: Glenn-1990 <g_christiaensen at msn.com>
Date: Mon Jan 4 14:28:33 2016 +0100
Use removal as lifetime for htspv25+
diff --git a/src/AutoRecordings.cpp b/src/AutoRecordings.cpp
index 34b9bfc..74a0864 100644
--- a/src/AutoRecordings.cpp
+++ b/src/AutoRecordings.cpp
@@ -158,10 +158,15 @@ PVR_ERROR AutoRecordings::SendAutorecAdd(const PVR_TIMER &timer)
htsmsg_add_s64(m, "startExtra", timer.iMarginStart);
htsmsg_add_s64(m, "stopExtra", timer.iMarginEnd);
- htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
- if (m_conn.GetProtocol() >= 24)
- htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ if (m_conn.GetProtocol() >= 25)
+ {
+ htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ htsmsg_add_u32(m, "retention", DVR_RET_ONREMOVE); // remove from tvh database
+ }
+ else
+ htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
+
htsmsg_add_u32(m, "daysOfWeek", timer.iWeekdays);
@@ -327,24 +332,29 @@ bool AutoRecordings::ParseAutorecAddOrUpdate(htsmsg_t *msg, bool bAdd)
return false;
}
- if (!htsmsg_get_u32(msg, "retention", &u32))
- {
- rec.SetRetention(u32);
- }
- else if (bAdd)
- {
- Logger::Log(LogLevel::ERROR, "malformed autorecEntryAdd: 'retention' missing");
- return false;
- }
-
- if (!htsmsg_get_u32(msg, "removal", &u32))
+ if (m_conn.GetProtocol() >= 25)
{
- rec.SetRemoval(u32);
+ if (!htsmsg_get_u32(msg, "removal", &u32))
+ {
+ rec.SetLifetime(u32);
+ }
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed autorecEntryAdd: 'removal' missing");
+ return false;
+ }
}
- else if (bAdd && (m_conn.GetProtocol() >= 24))
+ else
{
- Logger::Log(LogLevel::ERROR, "malformed autorecEntryAdd: 'removal' missing");
- return false;
+ if (!htsmsg_get_u32(msg, "retention", &u32))
+ {
+ rec.SetLifetime(u32);
+ }
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed autorecEntryAdd: 'retention' missing");
+ return false;
+ }
}
if (!htsmsg_get_u32(msg, "daysOfWeek", &u32))
diff --git a/src/TimeRecordings.cpp b/src/TimeRecordings.cpp
index ded8ba4..f8ba733 100644
--- a/src/TimeRecordings.cpp
+++ b/src/TimeRecordings.cpp
@@ -130,10 +130,14 @@ PVR_ERROR TimeRecordings::SendTimerecAdd(const PVR_TIMER &timer)
struct tm *tm_stop = localtime(&timer.endTime);
htsmsg_add_u32(m, "stop", tm_stop->tm_hour * 60 + tm_stop->tm_min); // end time in minutes from midnight
htsmsg_add_u32(m, "channelId", timer.iClientChannelUid);
- htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
- if (m_conn.GetProtocol() >= 24)
- htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ if (m_conn.GetProtocol() >= 25)
+ {
+ htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ htsmsg_add_u32(m, "retention", DVR_RET_ONREMOVE); // remove from tvh database
+ }
+ else
+ htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
htsmsg_add_u32(m, "daysOfWeek", timer.iWeekdays);
htsmsg_add_u32(m, "priority", timer.iPriority);
@@ -253,24 +257,29 @@ bool TimeRecordings::ParseTimerecAddOrUpdate(htsmsg_t *msg, bool bAdd)
return false;
}
- if (!htsmsg_get_u32(msg, "retention", &u32))
- {
- rec.SetRetention(u32);
- }
- else if (bAdd)
- {
- Logger::Log(LogLevel::ERROR, "malformed timerecEntryAdd: 'retention' missing");
- return false;
- }
-
- if (!htsmsg_get_u32(msg, "removal", &u32))
+ if (m_conn.GetProtocol() >= 25)
{
- rec.SetRemoval(u32);
+ if (!htsmsg_get_u32(msg, "removal", &u32))
+ {
+ rec.SetLifetime(u32);
+ }
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed timerecEntryAdd: 'removal' missing");
+ return false;
+ }
}
- else if (bAdd && (m_conn.GetProtocol() >= 24))
+ else
{
- Logger::Log(LogLevel::ERROR, "malformed timerecEntryAdd: 'removal' missing");
- return false;
+ if (!htsmsg_get_u32(msg, "retention", &u32))
+ {
+ rec.SetLifetime(u32);
+ }
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed timerecEntryAdd: 'retention' missing");
+ return false;
+ }
}
if (!htsmsg_get_u32(msg, "priority", &u32))
diff --git a/src/Tvheadend.cpp b/src/Tvheadend.cpp
index 346f86a..7671a94 100644
--- a/src/Tvheadend.cpp
+++ b/src/Tvheadend.cpp
@@ -459,7 +459,7 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle )
/* Priority */
rec.iPriority = recording.GetPriority();
- /* Lifetime (based on retention and removal) */
+ /* Lifetime (based on retention or removal) */
rec.iLifetime = recording.GetLifetime();
/* Directory */
@@ -999,10 +999,14 @@ PVR_ERROR CTvheadend::AddTimer ( const PVR_TIMER &timer )
htsmsg_add_s64(m, "startExtra", timer.iMarginStart);
htsmsg_add_s64(m, "stopExtra", timer.iMarginEnd);
- htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
- if (m_conn.GetProtocol() >= 24)
- htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ if (m_conn.GetProtocol() >= 25)
+ {
+ htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ htsmsg_add_u32(m, "retention", DVR_RET_ONREMOVE); // remove from tvh database
+ }
+ else
+ htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
htsmsg_add_u32(m, "priority", timer.iPriority);
@@ -1135,10 +1139,14 @@ PVR_ERROR CTvheadend::UpdateTimer ( const PVR_TIMER &timer )
htsmsg_add_str(m, "description", timer.strSummary);
htsmsg_add_s64(m, "startExtra", timer.iMarginStart);
htsmsg_add_s64(m, "stopExtra", timer.iMarginEnd);
- htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
- if (m_conn.GetProtocol() >= 24)
+ if (m_conn.GetProtocol() >= 25)
+ {
htsmsg_add_u32(m, "removal", timer.iLifetime); // remove from disk
+ htsmsg_add_u32(m, "retention", DVR_RET_ONREMOVE);// remove from tvh database
+ }
+ else
+ htsmsg_add_u32(m, "retention", timer.iLifetime); // remove from tvh database
htsmsg_add_u32(m, "priority", timer.iPriority);
@@ -1865,20 +1873,25 @@ void CTvheadend::ParseRecordingAddOrUpdate ( htsmsg_t *msg, bool bAdd )
return;
}
- if (!htsmsg_get_u32(msg, "retention", &retention))
- rec.SetRetention(retention);
- else if (bAdd)
+ if (m_conn.GetProtocol() >= 25)
{
- Logger::Log(LogLevel::ERROR, "malformed dvrEntryAdd: 'retention' missing");
- return;
+ if (!htsmsg_get_u32(msg, "removal", &removal))
+ rec.SetLifetime(removal);
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed dvrEntryAdd: 'removal' missing");
+ return;
+ }
}
-
- if (!htsmsg_get_u32(msg, "removal", &removal))
- rec.SetRemoval(removal);
- else if (bAdd && (m_conn.GetProtocol() >= 24))
+ else
{
- Logger::Log(LogLevel::ERROR, "malformed dvrEntryAdd: 'removal' missing");
- return;
+ if (!htsmsg_get_u32(msg, "retention", &retention))
+ rec.SetLifetime(retention);
+ else if (bAdd)
+ {
+ Logger::Log(LogLevel::ERROR, "malformed dvrEntryAdd: 'retention' missing");
+ return;
+ }
}
if (!htsmsg_get_u32(msg, "priority", &priority))
diff --git a/src/Tvheadend.h b/src/Tvheadend.h
index a73a7fc..942b67e 100644
--- a/src/Tvheadend.h
+++ b/src/Tvheadend.h
@@ -68,7 +68,7 @@ extern "C" {
* Configuration defines
*/
#define HTSP_MIN_SERVER_VERSION (19) // Server must support at least this htsp version
-#define HTSP_CLIENT_VERSION (24) // Client uses HTSP features up to this version. If the respective
+#define HTSP_CLIENT_VERSION (25) // Client uses HTSP features up to this version. If the respective
// addon feature requires htsp features introduced after
// HTSP_MIN_SERVER_VERSION this feature will only be available if the
// actual server HTSP version matches (runtime htsp version check).
diff --git a/src/tvheadend/entity/Recording.h b/src/tvheadend/entity/Recording.h
index a528e0f..5e22538 100644
--- a/src/tvheadend/entity/Recording.h
+++ b/src/tvheadend/entity/Recording.h
@@ -61,8 +61,7 @@ namespace tvheadend
m_startExtra(0),
m_stopExtra(0),
m_state(PVR_TIMER_STATE_ERROR),
- m_retention(99), // Kodi default - "99 days"
- m_removal(-1), // max value to stay compatible with older backends
+ m_lifetime(0),
m_priority(50) // Kodi default - "normal"
{
}
@@ -84,8 +83,7 @@ namespace tvheadend
m_autorecId == other.m_autorecId &&
m_state == other.m_state &&
m_error == other.m_error &&
- m_retention == other.m_retention &&
- m_removal == other.m_removal &&
+ m_lifetime == other.m_lifetime &&
m_priority == other.m_priority;
}
@@ -174,9 +172,8 @@ namespace tvheadend
void SetError(const std::string &error) { m_error = error; }
// Lifetime = the smallest value
- uint32_t GetLifetime() const { return std::min(m_removal, m_retention); }
- void SetRetention(uint32_t retention) { m_retention = retention; }
- void SetRemoval(uint32_t removal) { m_removal = removal; }
+ uint32_t GetLifetime() const { return m_lifetime; }
+ void SetLifetime(uint32_t lifetime) { m_lifetime = lifetime; }
uint32_t GetPriority() const { return m_priority; }
void SetPriority(uint32_t priority) { m_priority = priority; }
@@ -197,8 +194,7 @@ namespace tvheadend
std::string m_autorecId;
PVR_TIMER_STATE m_state;
std::string m_error;
- uint32_t m_retention;
- uint32_t m_removal;
+ uint32_t m_lifetime;
uint32_t m_priority;
};
}
diff --git a/src/tvheadend/entity/RecordingBase.cpp b/src/tvheadend/entity/RecordingBase.cpp
index edfaa77..e08dda9 100644
--- a/src/tvheadend/entity/RecordingBase.cpp
+++ b/src/tvheadend/entity/RecordingBase.cpp
@@ -29,8 +29,7 @@ RecordingBase::RecordingBase(const std::string &id /*= ""*/) :
m_sid(id),
m_enabled(0),
m_daysOfWeek(0),
- m_retention(0),
- m_removal(-1), // max value to stay compatible with older backends
+ m_lifetime(0),
m_priority(0),
m_channel(0)
{
@@ -42,8 +41,7 @@ bool RecordingBase::operator==(const RecordingBase &right)
return m_id == right.m_id &&
m_enabled == right.m_enabled &&
m_daysOfWeek == right.m_daysOfWeek &&
- m_retention == right.m_retention &&
- m_removal == right.m_removal &&
+ m_lifetime == right.m_lifetime &&
m_priority == right.m_priority &&
m_title == right.m_title &&
m_name == right.m_name &&
@@ -88,20 +86,14 @@ void RecordingBase::SetDaysOfWeek(uint32_t daysOfWeek)
m_daysOfWeek = daysOfWeek;
}
-// Lifetime = the smallest value
uint32_t RecordingBase::GetLifetime() const
{
- return std::min(m_removal, m_retention);
+ return m_lifetime;
}
-void RecordingBase::SetRetention(uint32_t retention)
+void RecordingBase::SetLifetime(uint32_t lifetime)
{
- m_retention = retention;
-}
-
-void RecordingBase::SetRemoval(uint32_t removal)
-{
- m_removal = removal;
+ m_lifetime = lifetime;
}
uint32_t RecordingBase::GetPriority() const
diff --git a/src/tvheadend/entity/RecordingBase.h b/src/tvheadend/entity/RecordingBase.h
index f179703..3e81152 100644
--- a/src/tvheadend/entity/RecordingBase.h
+++ b/src/tvheadend/entity/RecordingBase.h
@@ -48,8 +48,7 @@ namespace tvheadend
void SetDaysOfWeek(uint32_t daysOfWeek);
uint32_t GetLifetime() const;
- void SetRetention(uint32_t retention);
- void SetRemoval(uint32_t removal);
+ void SetLifetime(uint32_t retention);
uint32_t GetPriority() const;
void SetPriority(uint32_t priority);
@@ -78,8 +77,7 @@ namespace tvheadend
std::string m_sid; // ID (string!) of dvr[Time|Auto]recEntry.
uint32_t m_enabled; // If [time|auto]rec entry is enabled (activated).
uint32_t m_daysOfWeek; // Bitmask - Days of week (0x01 = Monday, 0x40 = Sunday, 0x7f = Whole Week, 0 = Not set).
- uint32_t m_retention; // Lifetime time of database entry (in days).
- uint32_t m_removal; // Lifetime time of actual file on disk (in days).
+ uint32_t m_lifetime; // Lifetime (in days).
uint32_t m_priority; // Priority (0 = Important, 1 = High, 2 = Normal, 3 = Low, 4 = Unimportant).
std::string m_title; // Title (pattern) for the recording files.
std::string m_name; // Name.
--
kodi-pvr-hts packaging
More information about the pkg-multimedia-commits
mailing list