Skip to content

Commit

Permalink
Merge pull request #471 from phunkyfish/internal-openwebif-movielist
Browse files Browse the repository at this point in the history
Add expert setting to toggle using OpenWebIf internal MovieList on/off
  • Loading branch information
phunkyfish authored Nov 5, 2024
2 parents 1606537 + 2af9925 commit 3afa0a1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ The following configuration is available on the Recordings tab of the addon sett
* **Enable EDLs support**: EDLs are used to define commericals etc. in recordings. If a tool like [Comskip]() is used to generate EDL files enabling this will allow Kodi PVR to use them. E.g. if there is a file called ```my recording.ts``` the EDL file should be call ```my recording.edl```. Note: enabling this setting has no effect if the files are not present.
* **EDL start time padding**: Padding to use at an EDL stop. I.e. use a negative number to start the cut earlier and positive to start the cut later. Default 0.
* **EDL stop time padding**: Padding to use at an EDL stop. I.e. use a negative number to stop the cut earlier and positive to stop the cut later. Default 0.
* **Enable WebIf Internal Movie List**: Use internal OWF MovieList (avoids memory leak on some images). Note: this will only have an effect if OpenWebIf is of the minimum supported version (1.4.6).

### Timers

Expand Down
2 changes: 1 addition & 1 deletion pvr.vuplus/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.vuplus"
version="22.2.0"
version="22.3.0"
name="Enigma2 Client"
provider-name="Joerg Dembski and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down
3 changes: 3 additions & 0 deletions pvr.vuplus/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v22.3.0
- Add expert setting to toggle using OpenWebIf internal MovieList on/off

v22.2.0
- PVR Add-on API v9.2.0

Expand Down
5 changes: 5 additions & 0 deletions pvr.vuplus/resources/instance-settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@
</constraints>
<control type="spinner" format="integer" />
</setting>
<setting id="enablewebifinternalmovielist" type="boolean" label="30021" help="30692">
<level>3</level>
<default>true</default>
<control type="toggle" />
</setting>
</group>

<group id="2" label="30157">
Expand Down
12 changes: 10 additions & 2 deletions pvr.vuplus/resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ msgctxt "#30020"
msgid "Advanced"
msgstr ""

#empty string with id 30021
#. label: Recordings - enablewebifinternalmovielist
msgctxt "#30021"
msgid "Enable WebIf Internal Movie List"
msgstr ""

#. label: Recordings - recordingsrecursive
msgctxt "#30022"
Expand Down Expand Up @@ -1310,7 +1313,12 @@ msgctxt "#30691"
msgid "Create a virtual structure grouping recordings with the same name into folders. Will be applied to all recordings unless keeping the folder structure on the backend. In that case it will only be applied to the recordings in the root of each recording location."
msgstr ""

#empty strings from id 30692 to 30699
#. help: Recordings - enablewebifinternalmovielist
msgctxt "#30692"
msgid "Use internal OWF MovieList (avoids memory leak on some images). Note: this will only have an effect if OpenWebIf is of the minimum supported version (1.4.6)."
msgstr ""

#empty strings from id 30693 to 30699

#. help info - Timers

Expand Down
3 changes: 3 additions & 0 deletions src/enigma2/InstanceSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void InstanceSettings::ReadSettings()
m_instance.CheckInstanceSettingBoolean("enablerecordingedls", m_enableRecordingEDLs);
m_instance.CheckInstanceSettingInt("edlpaddingstart", m_edlStartTimePadding);
m_instance.CheckInstanceSettingInt("edlpaddingstop", m_edlStopTimePadding);
m_instance.CheckInstanceSettingBoolean("enablewebifinternalmovielist", m_enableWebIfInternalMovieList);

//Timers
m_instance.CheckInstanceSettingBoolean("enablegenrepeattimers", m_enableGenRepeatTimers);
Expand Down Expand Up @@ -319,6 +320,8 @@ ADDON_STATUS InstanceSettings::SetSetting(const std::string& settingName, const
return SetSetting<int, ADDON_STATUS>(settingName, settingValue, m_edlStartTimePadding, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "edlpaddingstop")
return SetSetting<int, ADDON_STATUS>(settingName, settingValue, m_edlStopTimePadding, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "enablewebifinternalmovielist")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_enableWebIfInternalMovieList, ADDON_STATUS_NEED_RESTART, ADDON_STATUS_OK);
//Timers
else if (settingName == "enablegenrepeattimers")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_enableGenRepeatTimers, ADDON_STATUS_OK, ADDON_STATUS_OK);
Expand Down
2 changes: 2 additions & 0 deletions src/enigma2/InstanceSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ namespace enigma2
bool GetRecordingEDLsEnabled() const { return m_enableRecordingEDLs; }
int GetEDLStartTimePadding() const { return m_edlStartTimePadding; }
int GetEDLStopTimePadding() const { return m_edlStopTimePadding; }
bool GetWebIfInternalMovieListEnabled() const { return m_enableWebIfInternalMovieList; }

//Timers
bool GetGenRepeatTimersEnabled() const { return m_enableGenRepeatTimers; }
Expand Down Expand Up @@ -389,6 +390,7 @@ namespace enigma2
bool m_enableRecordingEDLs = false;
int m_edlStartTimePadding = 0;
int m_edlStopTimePadding = 0;
bool m_enableWebIfInternalMovieList = true;

//Timers
bool m_enableGenRepeatTimers = true;
Expand Down
8 changes: 4 additions & 4 deletions src/enigma2/Recordings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ void Recordings::LoadRecordings(bool deleted)
namespace
{

std::string GetRecordingsParams(const std::string recordingLocation, bool deleted, bool getRecordingsRecursively, bool supportsMovieListRecursive, bool supportsMovieListOWFInternal)
std::string GetRecordingsParams(const std::string recordingLocation, bool deleted, bool getRecordingsRecursively, bool supportsMovieListRecursive, bool supportsMovieListOWFInternal, bool webIfInternalMovieListEnabled)
{
std::string recordingsParams;

Expand All @@ -772,14 +772,14 @@ std::string GetRecordingsParams(const std::string recordingLocation, bool delete

// &internal=true requests that openwebif uses it own OWFMovieList instead of the E2 MovieList
// becuase the E2 MovieList causes memory leaks
if (supportsMovieListOWFInternal)
if (supportsMovieListOWFInternal && webIfInternalMovieListEnabled)
recordingsParams += "&internal=1";
}
else
{
// &internal=true requests that openwebif uses it own OWFMovieList instead of the E2 MovieList
// becuase the E2 MovieList causes memory leaks
if (supportsMovieListOWFInternal)
if (supportsMovieListOWFInternal && webIfInternalMovieListEnabled)
{
if (recordingLocation == "default")
recordingsParams += "?internal=1";
Expand All @@ -798,7 +798,7 @@ bool Recordings::GetRecordingsFromLocation(const std::string recordingLocation,
std::string url;
std::string directory;

std::string recordingsParams = GetRecordingsParams(recordingLocation, deleted, m_settings->GetRecordingsRecursively(), m_settings->SupportsMovieListRecursive(), m_settings->SupportsMovieListOWFInternal());
std::string recordingsParams = GetRecordingsParams(recordingLocation, deleted, m_settings->GetRecordingsRecursively(), m_settings->SupportsMovieListRecursive(), m_settings->SupportsMovieListOWFInternal(), m_settings->GetWebIfInternalMovieListEnabled());

if (recordingLocation == "default")
{
Expand Down

0 comments on commit 3afa0a1

Please sign in to comment.