Skip to content

Commit

Permalink
Merge pull request #266 from phunkyfish/refactor-matrix
Browse files Browse the repository at this point in the history
Refactor matrix, support for #EXTGRP, fix for channel groups and auto reload
  • Loading branch information
phunkyfish authored Aug 26, 2019
2 parents efd8a3e + cdb8645 commit 6d525c8
Show file tree
Hide file tree
Showing 36 changed files with 3,369 additions and 1,436 deletions.
29 changes: 27 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,35 @@ set(DEPLIBS ${p8-platform_LIBRARIES}
message(STATUS "ZLIB_LIBRARIES: ${ZLIB_LIBRARIES}")

set(IPTV_SOURCES src/client.cpp
src/PVRIptvData.cpp)
src/PVRIptvData.cpp
src/iptvsimple/Settings.cpp
src/iptvsimple/Channels.cpp
src/iptvsimple/ChannelGroups.cpp
src/iptvsimple/Epg.cpp
src/iptvsimple/PlaylistLoader.cpp
src/iptvsimple/data/Channel.cpp
src/iptvsimple/data/ChannelEpg.cpp
src/iptvsimple/data/ChannelGroup.cpp
src/iptvsimple/data/EpgEntry.cpp
src/iptvsimple/data/EpgGenre.cpp
src/iptvsimple/utilities/FileUtils.cpp
src/iptvsimple/utilities/Logger.cpp)

set(IPTV_HEADERS src/client.h
src/PVRIptvData.h)
src/PVRIptvData.h
src/iptvsimple/Settings.h
src/iptvsimple/Channels.h
src/iptvsimple/ChannelGroups.h
src/iptvsimple/Epg.h
src/iptvsimple/PlaylistLoader.h
src/iptvsimple/data/Channel.h
src/iptvsimple/data/ChannelEpg.h
src/iptvsimple/data/ChannelGroup.h
src/iptvsimple/data/EpgEntry.h
src/iptvsimple/data/EpgGenre.h
src/iptvsimple/utilities/FileUtils.h
src/iptvsimple/utilities/Logger.h
src/iptvsimple/utilities/XMLUtils.h)

addon_version(pvr.iptvsimple IPTV)
add_definitions(-DIPTV_VERSION=${IPTV_VERSION})
Expand Down
68 changes: 65 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# IPTV Simple PVR

IPTV Live TV and Radio PVR client addon for [Kodi](http://kodi.tv)
IPTV Live TV and Radio PVR client addon for [Kodi](https://kodi.tv)

## Build instructions

Expand Down Expand Up @@ -42,7 +42,69 @@ Note that the steps in the following section need to be performed before the add
1. `cd $HOME/pvr.iptvsimple`
2. `./build-install-mac.sh ../xbmc-addon`

If you would prefer to run the rebuild steps manually instead of using the above helper script check the appendix [here](#manual-steps-to-rebuild-the-addon-on-macosx)

##### Useful links

* [Kodi's PVR user support](http://forum.kodi.tv/forumdisplay.php?fid=167)
* [Kodi's PVR development support](http://forum.kodi.tv/forumdisplay.php?fid=136)
* [Kodi's PVR user support](https://forum.kodi.tv/forumdisplay.php?fid=167)
* [Kodi's PVR development support](https://forum.kodi.tv/forumdisplay.php?fid=136)

### 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 settingds level from within the addon settings itself.

### General
General settings required for the addon to function.

* **Location**: Select where to find the M3U resource. The options are:
- `Local path` - A path to an M3U file whether it be on the device or the local network.
- `Remote path` - A URL specifying the location of the M3U file.
* **M3U play list path**: If location is `Local path` this setting must contain a valid path for the addon to function.
* **M3U play list URL**: If location is `Remote path` this setting must contain a valid URL for the addon to function.
* **Cache M3U at local storage**: If location is `Remote path` select whether or not the the M3U file should be cached locally.
* **Start channel number**: The number to start numbering channels from.

### EPG Settings
Settings related to the EPG.

* **Location**: Select where to find the XMLTV resource. The options are:
- `Local path` - A path to an XMLTV file whether it be on the device or the local network.
- `Remote path` - A URL specifying the location of the XMLTV file.
* **XMLTV path**: If location is `Local Path` this setting should contain a valid path.
* **XMLTV URL**: If location is `Remote Path` this setting should contain a valid URL.
* **Cache XMLTV at local storage**: If location is `Remote path` select whether or not the the XMLTV file should be cached locally.
* **EPG time shift**: Adjust the EPG times by this value in minutes, range is from -720 mins to +720 mins (+/- 12 hours).
* **Apply time shift to all channels**: Whether or not to override the time shift for all channels with `EPG time shift`. If not enabled `EPG time shift` plus the individual time shift per channel (if available) will be used.

### Channel Logos
Settings realted to Channel Logos.

* **Location**: Select where to find the channel logos. The options are:
- `Local path` - A path to a folder whether it be on the device or the local network.
- `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.
* **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.
- `Prefer XMLTV` - Use the channel logo from the XMLTV file if available otherwise use the M3U logo.

## Appendix

### Manual Steps to rebuild the addon on MacOSX

The following steps can be followed manually instead of using the `build-install-mac.sh` in the root of the addon repo after the [initial addon build](#build-tools-and-initial-addon-build) has been completed.

**To rebuild the addon after changes**

1. `rm tools/depends/target/binary-addons/.installed-macosx*`
2. `make -j$(getconf _NPROCESSORS_ONLN) -C tools/depends/target/binary-addons ADDONS="pvr.vuplus" ADDON_SRC_PREFIX=$HOME`

or

1. `cd tools/depends/target/binary-addons/macosx*`
2. `make`

**Copy the addon to the Kodi addon directory on Mac**

1. `rm -rf "$HOME/Library/Application Support/Kodi/addons/pvr.vuplus"`
2. `cp -rf $HOME/xbmc-addon/addons/pvr.vuplus "$HOME/Library/Application Support/Kodi/addons"`
23 changes: 18 additions & 5 deletions build-install-mac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -e

if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then
echo "Usage: $0 <XBMC-SRC-DIR>" >&2
exit 1
Expand All @@ -10,6 +12,16 @@ if [[ "$OSTYPE" != "darwin"* ]]; then
exit 1
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [[ "$1" = /* ]]
then
#absolute path
SCRIPT_DIR=""
else
#relative
SCRIPT_DIR="$SCRIPT_DIR/"
fi

BINARY_ADDONS_TARGET_DIR="$1/tools/depends/target/binary-addons"
MACOSX_BINARY_ADDONS_TARGET_DIR=""
KODI_ADDONS_DIR="$HOME/Library/Application Support/Kodi/addons"
Expand All @@ -20,16 +32,15 @@ if [ ! -d "$BINARY_ADDONS_TARGET_DIR" ]; then
exit 1
fi

XBMC_BUILD_ADDON_INSTALL_DIR=$(cd $1/addons/$ADDON_NAME 2> /dev/null && pwd -P)

for DIR in "$BINARY_ADDONS_TARGET_DIR/"macosx*; do
if [ -d "${DIR}" ]; then
MACOSX_BINARY_ADDONS_TARGET_DIR="${DIR}"
MACOSX_BINARY_ADDONS_TARGET_DIR="${DIR}"
break
fi
done

if [ -z "$MACOSX_BINARY_ADDONS_TARGET_DIR" ]; then
echo "Error: Could not find binary addons build directory at: $BINARY_ADDONS_DIR/macosx*" >&2
echo "Error: Could not find binary addons build directory at: $BINARY_ADDONS_TARGET_DIR/macosx*" >&2
exit 1
fi

Expand All @@ -40,5 +51,7 @@ fi

cd "$MACOSX_BINARY_ADDONS_TARGET_DIR"
make

XBMC_BUILD_ADDON_INSTALL_DIR=$(cd "$SCRIPT_DIR$1/addons/$ADDON_NAME" 2> /dev/null && pwd -P)
rm -rf "$KODI_ADDONS_DIR/$ADDON_NAME"
cp -rf "$XBMC_BUILD_ADDON_INSTALL_DIR" "$KODI_ADDONS_DIR"
cp -rf "$XBMC_BUILD_ADDON_INSTALL_DIR" "$KODI_ADDONS_DIR"
2 changes: 1 addition & 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="4.2.2"
version="4.3.0"
name="PVR IPTV Simple Client"
provider-name="nightik">
<requires>@ADDON_DEPENDS@</requires>
Expand Down
6 changes: 6 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v4.3.0
- Added: Auto reload channels, groups and EPG on settings change
- Added: Support for #EXTGRP tag in M3U file
- Fixed: Channel with no groups inherit previous channels groups
- Added: update new file kodi headers to start with kodi/

v4.2.2
- Update build system version
- Change header include way
Expand Down
Loading

0 comments on commit 6d525c8

Please sign in to comment.