Skip to content

Commit

Permalink
Merge pull request #506 from phunkyfish/local-logos-only
Browse files Browse the repository at this point in the history
Local logos only
  • Loading branch information
phunkyfish authored Apr 9, 2021
2 parents ca09401 + bde9d57 commit 292ce5f
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 6 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The contents of this README.md file are as follows:
5. [Appendix](#appendix)
* [Catchup format specifiers](#catchup-format-specifiers)
* [Supported M3U and XMLTV elements](#supported-m3u-and-xmltv-elements)
* [Online M3U and XMLTV Editors](#online-m3u-and-xmltv-editors)
* [XEEV](#xeev)
* [HTTP header fields supported by Kodi](#http-header-fields-supported-by-kodi)
* [Manual Steps to rebuild the addon on MacOSX](#manual-steps-to-rebuild-the-addon-on-macosx)

Expand Down Expand Up @@ -85,7 +87,7 @@ If you would prefer to run the rebuild steps manually instead of using the above
## Configuring the addon

### Settings Levels
In Kodi 18.2 the level of settings shown will correspond to the level set in the main Kodi settings UI: `Basic`, `Standard`, `Advanced` and `Expert`. From Kodi 19 it will be possible to change the settings level from within the addon settings itself.
Settings levels can be selected within the addon settings dialog. The options are: `Basic`, `Standard`, `Advanced` and `Expert`. If there are settings below that cannot be found it is most liekly because they are only available at a higher settings level.

### General
General settings required for the addon to function.
Expand Down Expand Up @@ -155,6 +157,7 @@ Settings related to Channel Logos.
- `Remote path ` - A base URL specifying the location of the logos.
* **Channel logos folder**: If location is `Local Path` this setting should contain a valid folder.
* **Channel logos base URL**: If location is `Remote Path` this setting should contain a valid base URL.
* **For local logos path ignore M3U logos**: If a local path is selected for logos ignore any logos from the M3U file.
* **Channel logos from XMLTV**: Preference on how to handle channel logos. The options are:
- `Ignore` - Don't use channel logos from an XMLTV file.
- `Prefer M3U` - Use the channel logo from the M3U if available otherwise use the XMLTV logo.
Expand Down Expand Up @@ -517,6 +520,12 @@ The `programme` element supports the attributes `start`/`stop` in the format `YY
- `credits`: Only director, writer and actor are supported (multiple of each can be supplied).
- `icon`: If multiple elements are provided only the first will be used.

### Online M3U and XMLTV Editors

#### XEEV

If using the XEEV online editor for your playlist storage you should set the `Use XC2 API Protocol` flag.

### HTTP header fields supported by Kodi

HTTP header fields can be sent by appending the following format to the URL: `|name1=val1&name2=val2`. Note that Kodi does not support sending not standard header fields.
Expand Down
5 changes: 4 additions & 1 deletion pvr.iptvsimple/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.iptvsimple"
version="7.6.0"
version="7.6.1"
name="PVR IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down Expand Up @@ -169,6 +169,9 @@
<icon>icon.png</icon>
</assets>
<news>
v7.6.1
- Fixed: Allow ignoring M3U logos when using local logo path

v7.6.0
- Added: Support url-tvg in M3U header in addition to x-tvg-url
- Added: Add support for XZ compression of XMLTV data
Expand Down
3 changes: 3 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v7.6.1
- Fixed: Allow ignoring M3U logos when using local logo path

v7.6.0
- Added: Support url-tvg in M3U header in addition to x-tvg-url
- Added: Add support for XZ compression of XMLTV data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ msgstr ""
#. label-option: General - logoPathType
#. label-option: General - genresPathType
msgctxt "#30001"
msgid "Local path (include local network)"
msgid "Local path (includes local network)"
msgstr ""

#. label-option: General - m3uPathType
Expand Down Expand Up @@ -389,7 +389,12 @@ msgctxt "#30074"
msgid "Only load Radio channels in groups"
msgstr ""

#empty strings from id 30075 to 30099
#. help: Channel Logos - useLogosLocalPathOnly
msgctxt "#30075"
msgid "For local logos path ignore M3U logos"
msgstr ""

#empty strings from id 30076 to 30099

#. label-category: catchup
#. label-group: Catchup - Catchup
Expand Down Expand Up @@ -749,7 +754,12 @@ msgctxt "#30644"
msgid "Preference on how to handle channel logos. The options are: [B]Ignore[/B] - Don't use channel logos from an XMLTV file; [B]Prefer M3U[/B] - Use the channel logo from the M3U if available otherwise use the XMLTV logo; [B]Prefer XMLTV[/B] - Use the channel logo from the XMLTV file if available otherwise use the M3U logo."
msgstr ""

#empty strings from id 30645 to 30659
#. help: Channel Logos - useLogosLocalPathOnly
msgctxt "#30645"
msgid "If a local path is selected for logos ignore any logos from the M3U file."
msgstr ""

#empty strings from id 30646 to 30659

#. help info - Genres

Expand Down
8 changes: 8 additions & 0 deletions pvr.iptvsimple/resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,14 @@
</dependencies>
<control type="edit" format="string" />
</setting>
<setting id="useLogosLocalPathOnly" type="boolean" label="30075" help="30645">
<level>2</level>
<default>false</default>
<dependencies>
<dependency type="visible" setting="logoPathType" operator="is">0</dependency>
</dependencies>
<control type="toggle" />
</setting>
</group>
<group id="2" label="30040">
<setting id="logoFromEpg" type="integer" label="30041" help="30644">
Expand Down
5 changes: 4 additions & 1 deletion src/iptvsimple/PlaylistLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ std::string PlaylistLoader::ParseIntoChannel(const std::string& line, Channel& c
channel.SetCatchupSource(strCatchupSource);
channel.SetTvgShift(static_cast<int>(tvgShiftDecimal * 3600.0));
channel.SetRadio(isRadio);
channel.SetIconPathFromTvgLogo(strTvgLogo, channelName);
if (Settings::GetInstance().GetLogoPathType() == PathType::LOCAL_PATH && Settings::GetInstance().UseLocalLogosOnlyIgnoreM3U())
channel.SetIconPathFromTvgLogo("", channelName);
else
channel.SetIconPathFromTvgLogo(strTvgLogo, channelName);
if (strTvgShift.empty())
channel.SetTvgShift(epgTimeShift);

Expand Down
3 changes: 3 additions & 0 deletions src/iptvsimple/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void Settings::ReadFromAddon(const std::string& userPath, const std::string& cli
m_logoPath = kodi::GetSettingString("logoPath");
m_logoBaseUrl = kodi::GetSettingString("logoBaseUrl");
m_epgLogosMode = kodi::GetSettingEnum<EpgLogosMode>("logoFromEpg", EpgLogosMode::IGNORE_XMLTV);
m_useLocalLogosOnly = kodi::GetSettingBoolean("useLogosLocalPathOnly", false);

// Timeshift
m_timeshiftEnabled = kodi::GetSettingBoolean("timeshiftEnabled", false);
Expand Down Expand Up @@ -245,6 +246,8 @@ ADDON_STATUS Settings::SetValue(const std::string& settingName, const kodi::CSet
return SetStringSetting<ADDON_STATUS>(settingName, settingValue, m_logoBaseUrl, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "logoFromEpg")
return SetEnumSetting<EpgLogosMode, ADDON_STATUS>(settingName, settingValue, m_epgLogosMode, ADDON_STATUS_OK, ADDON_STATUS_OK);
else if (settingName == "useLogosLocalPathOnly")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_useLocalLogosOnly, ADDON_STATUS_OK, ADDON_STATUS_OK);
// Timeshift
else if (settingName == "timeshiftEnabled")
return SetSetting<bool, ADDON_STATUS>(settingName, settingValue, m_timeshiftEnabled, ADDON_STATUS_OK, ADDON_STATUS_OK);
Expand Down
2 changes: 2 additions & 0 deletions src/iptvsimple/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ namespace iptvsimple
const std::string& GetLogoPath() const { return m_logoPath; }
const std::string& GetLogoBaseUrl() const { return m_logoBaseUrl; }
const EpgLogosMode& GetEpgLogosMode() const { return m_epgLogosMode; }
bool UseLocalLogosOnlyIgnoreM3U() const { return m_useLocalLogosOnly; }

bool IsTimeshiftEnabled() const { return m_timeshiftEnabled; }
bool IsTimeshiftEnabledAll() const { return m_timeshiftEnabledAll; }
Expand Down Expand Up @@ -280,6 +281,7 @@ namespace iptvsimple
std::string m_logoPath;
std::string m_logoBaseUrl;
EpgLogosMode m_epgLogosMode = EpgLogosMode::IGNORE_XMLTV;
bool m_useLocalLogosOnly = false;

// Timeshift
bool m_timeshiftEnabled = false;
Expand Down

0 comments on commit 292ce5f

Please sign in to comment.