Skip to content

Commit

Permalink
Populate EpisodePart
Browse files Browse the repository at this point in the history
PVR 9 allows populating EpisodePart on recordings.  Update package for release
  • Loading branch information
emveepee committed Aug 30, 2024
1 parent 3ba236a commit c3f5d40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pvr.nextpvr/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.nextpvr"
version="22.1.0"
version="22.2.0"
name="NextPVR PVR Client"
provider-name="Graeme Blackley">
<requires>@ADDON_DEPENDS@
<import addon="inputstream.ffmpegdirect" minversion="22.0.0"/>
<import addon="inputstream.ffmpegdirect" optional="true"/>
</requires>
<extension
point="kodi.pvrclient"
Expand Down
9 changes: 9 additions & 0 deletions pvr.nextpvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@

v22.2.0
- Start timeshift in realtime for radio playback
- Add support for episode and episode part parsing
- Clean up duplicated S/E information sent from NextPVR in the subtitle when no subtitle is present.
- Cache channel list updates, compress with zlib
- Upgrade tinyxml2
- Add EpisodePart to recordings

v22.1.0
- PVR Add-on API v9.0.0

Expand Down
6 changes: 3 additions & 3 deletions src/Recordings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,6 @@ bool Recordings::UpdatePvrRecording(const tinyxml2::XMLNode* pRecordingNode, kod
XMLUtils::GetString(pRecordingNode, "id", buffer);
tag.SetRecordingId(buffer);

tag.SetSeriesNumber(PVR_RECORDING_INVALID_SERIES_EPISODE);
tag.SetEpisodeNumber(PVR_RECORDING_INVALID_SERIES_EPISODE);
if (ParseNextPVRSubtitle(pRecordingNode, tag))
{
if (m_settings->m_separateSeasons && multipleSeasons && tag.GetSeriesNumber() != PVR_RECORDING_INVALID_SERIES_EPISODE)
Expand Down Expand Up @@ -521,16 +519,18 @@ bool Recordings::ParseNextPVRSubtitle(const tinyxml2::XMLNode *pRecordingNode, k
const std::string plot = tag.GetPlot();
if (tag.GetEpisodeNumber() == PVR_RECORDING_INVALID_SERIES_EPISODE && !plot.empty());
{
// Kodi doesn't support episode parts on recordings
static std::regex base_regex("^.*\\([eE][pP](\\d+)(?:/?(\\d+))?\\)");
std::smatch base_match;
if (std::regex_search(plot, base_match, base_regex))
{
tag.SetEpisodeNumber(std::atoi(base_match[1].str().c_str()));
if (base_match[2].matched)
tag.SetEpisodePartNumber(std::atoi(base_match[2].str().c_str()));
}
else if (std::regex_search(plot, base_match, std::regex("^([1-9]\\d*)/([1-9]\\d*)\\.")))
{
tag.SetEpisodeNumber(std::atoi(base_match[1].str().c_str()));
tag.SetEpisodePartNumber(std::atoi(base_match[2].str().c_str()));
}
}
}
Expand Down

0 comments on commit c3f5d40

Please sign in to comment.