Skip to content

Commit

Permalink
use title and UNIX end time when generating recording/programme ident…
Browse files Browse the repository at this point in the history
…ifiers,

otherwise the identifiers may differ when external XMLTV is used (since the
time zone and channel ID may differ)
  • Loading branch information
Jalle19 committed Jun 12, 2015
1 parent 2975c07 commit bc776f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vbox/ContentIdentifier.h
Expand Up @@ -25,6 +25,8 @@
#include "Channel.h"
#include "Recording.h"
#include "../xmltv/Programme.h"
#include "../xmltv/Utilities.h"
#include "../compat.h"

namespace vbox {
/**
Expand All @@ -51,7 +53,8 @@ namespace vbox {
static unsigned int GetUniqueId(const vbox::Recording *recording)
{
std::hash<std::string> hasher;
int uniqueId = hasher(recording->m_channelId + recording->m_endTime);
std::string timestamp = compat::to_string(::xmltv::Utilities::XmltvToUnixTime(recording->m_endTime));
int uniqueId = hasher(std::string(recording->m_title) + timestamp);
return std::abs(uniqueId);
}

Expand All @@ -61,7 +64,8 @@ namespace vbox {
static unsigned int GetUniqueId(const xmltv::Programme *programme)
{
std::hash<std::string> hasher;
int uniqueId = hasher(programme->m_channelName + programme->m_endTime);
std::string timestamp = compat::to_string(::xmltv::Utilities::XmltvToUnixTime(programme->m_endTime));
int uniqueId = hasher(std::string(programme->m_title) + timestamp);
return std::abs(uniqueId);
}
};
Expand Down

0 comments on commit bc776f2

Please sign in to comment.