Skip to content

Commit 9487e86

Browse files
committed
Backport PR 286
Fix custom genre strings
1 parent 24e9ea0 commit 9487e86

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

pvr.nextpvr/changelog.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
v21.3.1
2+
- Fix custom genres
23
- Translations updates from Weblate
3-
- af_za, am_et, ar_sa, ast_es, az_az, be_by, bg_bg, bs_ba, ca_es, cs_cz, cy_gb, da_dk, de_de, el_gr, en_au, en_nz, en_us, eo, es_ar, es_es, es_mx, et_ee, eu_es, fa_af, fa_ir, fi_fi, fo_fo, fr_ca, fr_fr, gl_es, he_il, hi_in, hr_hr, hu_hu, hy_am, id_id, is_is, it_it, ja_jp, ko_kr, lt_lt, lv_lv, mi, mk_mk, ml_in, mn_mn, ms_my, mt_mt, my_mm, nb_no, nl_nl, pl_pl, pt_br, pt_pt, ro_ro, ru_ru, si_lk, sk_sk, sl_si, sq_al, sr_rs, sr_rs@latin, sv_se, szl, ta_in, te_in, tg_tj, th_th, tr_tr, uk_ua, uz_uz, vi_vn, zh_cn, zh_tw
4+
- af_za, am_et, ar_sa, ast_es, az_az, be_by, bg_bg, bs_ba, ca_es, cs_cz, cy_gb, da_dk, de_de, el_gr, en_au, en_nz, en_us, eo, es_ar, es_es, es_mx, et_ee, eu_es, fa_af, fa_ir, fi_fi, fo_fo, fr_ca, fr_fr, gl_es, he_il, hi_in, hr_hr, hu_hu, hy_am, id_id, is_is, it_it, ja_jp, ko_kr, lt_lt, lv_lv, mi, mk_mk, ml_in, mn_mn, ms_my, mt_mt, my_mm, nb_no, nl_nl, pl_pl, pt_br, pt_pt, ro_ro, ru_ru, si_lk, sk_sk, sl_si, sq_al, sr_rs, sr_rs@latin, sv_se, szl, ta_in, te_in, tg_tj, th_th, tr_tr, uk_ua, uz_uz, vi_vn, zh_cn, zh_tw
45

56
v21.3.0
67
- Support EPG genre sub type for better genre display

src/EPG.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ PVR_ERROR EPG::GetEPGForChannel(int channelUid, time_t start, time_t end, kodi::
118118
// genre type
119119
broadcast.SetGenreType(XMLUtils::GetIntValue(pListingNode, "genre_type"));
120120
broadcast.SetGenreSubType(XMLUtils::GetIntValue(pListingNode, "genre_sub_type"));
121-
122121
}
123122

124123
NextPVR::GenreBlock genreBlock = { sGenre, broadcast.GetGenreType(), EPG_EVENT_CONTENTMASK_UNDEFINED };
@@ -137,7 +136,7 @@ PVR_ERROR EPG::GetEPGForChannel(int channelUid, time_t start, time_t end, kodi::
137136
broadcast.SetEpisodePartNumber(EPG_TAG_INVALID_SERIES_EPISODE);
138137
// Backend could send epidode only as S00 and parts are not support
139138
if (season <= 0 || episode == EPG_TAG_INVALID_SERIES_EPISODE)
140-
{
139+
{
141140
std::regex base_regex("^.*\\([eE][pP](\\d+)(?:/?(\\d+))?\\)");
142141
std::smatch base_match;
143142
if (std::regex_search(description, base_match, base_regex))

src/utilities/GenreMapper.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ bool GenreMapper::ParseAllGenres(const tinyxml2::XMLNode* node, GenreBlock& genr
6666
{
6767
if (allGenres.find(EPG_STRING_TOKEN_SEPARATOR) != std::string::npos)
6868
{
69-
if (IsEnabled())
69+
if (UseDvbGenre())
7070
{
7171
std::vector<std::string> genreCodes = kodi::tools::StringUtils::Split(allGenres, EPG_STRING_TOKEN_SEPARATOR);
7272
if (genreCodes.size() == 2)
@@ -86,17 +86,14 @@ bool GenreMapper::ParseAllGenres(const tinyxml2::XMLNode* node, GenreBlock& genr
8686
}
8787
if (genreBlock.genreSubType == EPG_EVENT_CONTENTMASK_UNDEFINED)
8888
{
89-
if (genreBlock.genreType != EPG_GENRE_USE_STRING)
90-
{
91-
genreBlock.genreType = EPG_GENRE_USE_STRING;
92-
}
89+
genreBlock.genreSubType = EPG_GENRE_USE_STRING;
9390
genreBlock.description = allGenres;
9491
}
9592
}
96-
else if (!IsEnabled() && genreBlock.genreSubType != EPG_GENRE_USE_STRING)
93+
else if (!UseDvbGenre() && genreBlock.genreSubType == EPG_EVENT_CONTENTMASK_UNDEFINED)
9794
{
9895
genreBlock.description = allGenres;
99-
genreBlock.genreType = EPG_GENRE_USE_STRING;
96+
genreBlock.genreSubType = EPG_GENRE_USE_STRING;
10097
}
10198

10299
return true;

src/utilities/GenreMapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace NextPVR
2828
int GetGenreType(std::string code);
2929
int GetGenreSubType(std::string code);
3030
bool ParseAllGenres(const tinyxml2::XMLNode* node, GenreBlock& genreBlock);
31-
bool IsEnabled();
31+
bool UseDvbGenre();
3232

3333
private:
3434
GenreMapper() = default;

0 commit comments

Comments
 (0)