Merge branch 'pbiering/skindesigner-add-menurecording-recchannel-and-add-fallback'

This commit is contained in:
kamel5 2021-01-24 13:06:13 +01:00
commit 3255936658
7 changed files with 80 additions and 19 deletions

View File

@ -465,3 +465,5 @@ Version 1.2.9
Version 1.2.10 Version 1.2.10
- [pbiering] added tokens for recordings: isUHD, isRadio - [pbiering] added tokens for recordings: isUHD, isRadio
- [pbiering] added token for channels: isUHD - [pbiering] added token for channels: isUHD
- [pbiering] expose to displaymenurecordings: recchannelname, recchannelid, recchannelnumber
- [pbiering] add fallback to get name/id from 'info' in case channel is no longer in active channel list

View File

@ -1139,6 +1139,8 @@ enum class eLeMenuRecordingsST {
durationeventminutes, durationeventminutes,
thumbnailpath, thumbnailpath,
posterpath, posterpath,
recchannelname,
recchannelid,
count count
}; };
@ -1184,6 +1186,8 @@ enum class eCeMenuRecordingsST {
durationeventminutes, durationeventminutes,
thumbnailpath, thumbnailpath,
posterpath, posterpath,
recchannelname,
recchannelid,
count count
}; };

View File

@ -1754,6 +1754,8 @@ void cLeMenuRecordings::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{isHD}", (int)eLeMenuRecordingsIT::isHD); tokenContainer->DefineIntToken("{isHD}", (int)eLeMenuRecordingsIT::isHD);
tokenContainer->DefineIntToken("{isUHD}", (int)eLeMenuRecordingsIT::isUHD); tokenContainer->DefineIntToken("{isUHD}", (int)eLeMenuRecordingsIT::isUHD);
tokenContainer->DefineIntToken("{isRadio}", (int)eLeMenuRecordingsIT::isRadio); tokenContainer->DefineIntToken("{isRadio}", (int)eLeMenuRecordingsIT::isRadio);
tokenContainer->DefineStringToken("{recchannelname}", (int)eLeMenuRecordingsST::recchannelname);
tokenContainer->DefineStringToken("{recchannelid}", (int)eLeMenuRecordingsST::recchannelid);
InheritTokenContainer(); InheritTokenContainer();
} }
@ -1852,6 +1854,24 @@ bool cLeMenuRecordings::Parse(bool forced) {
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::epgname, info->Title() ? info->Title() : recName); tokenContainer->AddStringToken((int)eLeMenuRecordingsST::epgname, info->Title() ? info->Title() : recName);
delete[] recName; delete[] recName;
if (info) {
if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) {
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::recchannelname, info->ChannelName());
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::recchannelid, info->ChannelID().ToString());
} else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(info->ChannelID());
#else
const cChannel *channel = Channels.GetByChannelID(info->ChannelID());
#endif
if (channel) {
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::recchannelname, channel->Name());
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::recchannelid, *channel->GetChannelID().ToString());
}
}
}
cString recDate = event->GetDateString(); cString recDate = event->GetDateString();
cString recTime = event->GetTimeString(); cString recTime = event->GetTimeString();
if (strstr(*recDate, "1970")) { if (strstr(*recDate, "1970")) {
@ -2008,6 +2028,8 @@ void cCeMenuRecordings::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{isHD}", (int)eCeMenuRecordingsIT::isHD); tokenContainer->DefineIntToken("{isHD}", (int)eCeMenuRecordingsIT::isHD);
tokenContainer->DefineIntToken("{isUHD}", (int)eCeMenuRecordingsIT::isUHD); tokenContainer->DefineIntToken("{isUHD}", (int)eCeMenuRecordingsIT::isUHD);
tokenContainer->DefineIntToken("{isRadio}", (int)eCeMenuRecordingsIT::isRadio); tokenContainer->DefineIntToken("{isRadio}", (int)eCeMenuRecordingsIT::isRadio);
tokenContainer->DefineStringToken("{recchannelname}", (int)eCeMenuRecordingsST::recchannelname);
tokenContainer->DefineStringToken("{recchannelid}", (int)eCeMenuRecordingsST::recchannelid);
InheritTokenContainer(); InheritTokenContainer();
} }
@ -2112,6 +2134,24 @@ bool cCeMenuRecordings::Parse(bool forced) {
event = info->GetEvent(); event = info->GetEvent();
if (!event) return true; if (!event) return true;
if (info) {
if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) {
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::recchannelname, info->ChannelName());
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::recchannelid, info->ChannelID().ToString());
} else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(info->ChannelID());
#else
const cChannel *channel = Channels.GetByChannelID(info->ChannelID());
#endif
if (channel) {
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::recchannelname, channel->Name());
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::recchannelid, *channel->GetChannelID().ToString());
}
}
}
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::epgname, info->Title() ? info->Title() : buffer.c_str()); tokenContainer->AddStringToken((int)eCeMenuRecordingsST::epgname, info->Title() ? info->Title() : buffer.c_str());
cString recDate = event->GetDateString(); cString recDate = event->GetDateString();
cString recTime = event->GetTimeString(); cString recTime = event->GetTimeString();

View File

@ -812,6 +812,11 @@ void cViewDetailRec::SetRecInfos(void) {
const cRecordingInfo *info = recording->Info(); const cRecordingInfo *info = recording->Info();
if (info) { if (info) {
if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) {
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelname, info->ChannelName());
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelid, info->ChannelID().ToString());
tokenContainer->AddIntToken((int)eDmDetailedRecIT::recchannelnumber, 0); // cannot be provided, for backward compatibility only
} else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) #if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByChannelID(info->ChannelID()); const cChannel *channel = Channels->GetByChannelID(info->ChannelID());
@ -824,7 +829,7 @@ void cViewDetailRec::SetRecInfos(void) {
tokenContainer->AddIntToken((int)eDmDetailedRecIT::recchannelnumber, channel->Number()); tokenContainer->AddIntToken((int)eDmDetailedRecIT::recchannelnumber, channel->Number());
} }
} }
}
if (index) { if (index) {
int nLastIndex = index->Last(); int nLastIndex = index->Last();

View File

@ -1219,17 +1219,23 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
} }
if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) {
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelname, info->ChannelName());
tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelid, info->ChannelID().ToString());
tokenContainer->AddIntToken((int)eDmDetailedRecIT::recchannelnumber, 0); // cannot be provided, for backward compatibility only
} else {
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301) #if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ; LOCK_CHANNELS_READ;
const cChannels* channels = Channels; const cChannel *channel = Channels->GetByChannelID(info->ChannelID());
#else #else
cChannels* channels = &Channels; const cChannel *channel = Channels.GetByChannelID(info->ChannelID());
#endif #endif
const cChannel *channel = channels->GetByChannelID(info->ChannelID());
if (channel) { if (channel) {
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::recchannelname, channel->Name()); tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelname, channel->Name());
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::recchannelid, *channel->GetChannelID().ToString()); tokenContainer->AddStringToken((int)eDmDetailedRecST::recchannelid, *channel->GetChannelID().ToString());
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::recchannelnumber, channel->Number()); tokenContainer->AddIntToken((int)eDmDetailedRecIT::recchannelnumber, channel->Number());
}
} }
} }
string recImage = ""; string recImage = "";

View File

@ -21,7 +21,7 @@
#endif #endif
static const char *VERSION = "1.2.9"; static const char *VERSION = "1.2.10";
static const char *DESCRIPTION = trNOOP("Skin Designer"); static const char *DESCRIPTION = trNOOP("Skin Designer");
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI { class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {

View File

@ -33,6 +33,8 @@
{posterwidth} width of scraped poster {posterwidth} width of scraped poster
{posterheight} height of scraped poster {posterheight} height of scraped poster
{posterpath} absolute path of scraped poster {posterpath} absolute path of scraped poster
{recchannelname} name of channel from which was recorded
{recchannelid} id of channel from which was recorded
{framesPerSecond} frames per second (from EPG info) {framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD/UHD (from EPG info) {isHD} true if recording is HD/UHD (from EPG info)
{isUHD} true if recording is UHD (from EPG info) {isUHD} true if recording is UHD (from EPG info)
@ -76,6 +78,8 @@
{bannerwidth} width of scraped banner {bannerwidth} width of scraped banner
{bannerheight} height of scraped banner {bannerheight} height of scraped banner
{bannerpath} absolute path of scraped banner {bannerpath} absolute path of scraped banner
{recchannelname} name of channel from which was recorded
{recchannelid} id of channel from which was recorded
{framesPerSecond} frames per second (from EPG info) {framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD/UHD (from EPG info) {isHD} true if recording is HD/UHD (from EPG info)
{isUHD} true if recording is UHD (from EPG info) {isUHD} true if recording is UHD (from EPG info)