diff -pruN 19.7.13+ds1-1/CMakeLists.txt 20.2.1+ds1-1/CMakeLists.txt
--- 19.7.13+ds1-1/CMakeLists.txt	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/CMakeLists.txt	2022-01-02 17:18:23.000000000 +0000
@@ -30,9 +30,9 @@ set(ZATTOO_SOURCES
     src/epg/EpgProvider.cpp
     src/epg/ZattooEpgProvider.cpp
     src/Utils.cpp
+    src/client.cpp
     src/Settings.cpp
     src/ZatData.cpp
-    src/Session.cpp
     src/UpdateThread.cpp
     src/categories.cpp
     src/md5.cpp
@@ -53,8 +53,8 @@ set(ZATTOO_HEADERS
     src/Utils.h
     src/ZatChannel.h
     src/ZatData.h
-    src/Session.h
     src/categories.h
+    src/client.h
     src/windows.h
     src/md5.h
     src/to_string.h
@@ -72,7 +72,7 @@ if ( MSVC )
 endif ( MSVC )
 
 addon_version(pvr.zattoo ZATTOO)
-set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -DZATTOO_VERSION=${ZATTOO_VERSION} -DKODI_VERSION=${APP_VERSION_CODE}")
+set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -DZATTOO_VERSION=${ZATTOO_VERSION} -DKODI_VERSION=${kodiplatform_VERSION}")
 
 build_addon(pvr.zattoo ZATTOO DEPLIBS)
 
diff -pruN 19.7.13+ds1-1/debian/changelog 20.2.1+ds1-1/debian/changelog
--- 19.7.13+ds1-1/debian/changelog	2022-04-21 08:52:58.000000000 +0000
+++ 20.2.1+ds1-1/debian/changelog	2022-08-04 09:56:59.000000000 +0000
@@ -1,3 +1,10 @@
+kodi-pvr-zattoo (20.2.1+ds1-1) unstable; urgency=medium
+
+  * New upstream version 20.2.1+ds1
+  * Prepare for v20 in unstable
+
+ -- Vasyl Gello <vasek.gello@gmail.com>  Thu, 04 Aug 2022 09:56:59 +0000
+
 kodi-pvr-zattoo (19.7.13+ds1-1) unstable; urgency=medium
 
   * New upstream version 19.7.13+ds1
diff -pruN 19.7.13+ds1-1/debian/control 20.2.1+ds1-1/debian/control
--- 19.7.13+ds1-1/debian/control	2022-04-15 19:16:03.000000000 +0000
+++ 20.2.1+ds1-1/debian/control	2022-08-04 09:56:59.000000000 +0000
@@ -4,12 +4,12 @@ Section: libs
 Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
 Uploaders: Vasyl Gello <vasek.gello@gmail.com>
 Build-Depends: debhelper-compat (= 13)
-Build-Depends-Arch: dh-sequence-kodiaddon (>= 2:19~),
+Build-Depends-Arch: dh-sequence-kodiaddon (>= 2:20~),
                cmake,
                libtinyxml2-dev,
                pkg-config,
                rapidjson-dev
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
 Rules-Requires-Root: no
 Vcs-Browser: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-pvr-zattoo
 Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-pvr-zattoo.git
diff -pruN 19.7.13+ds1-1/debian/copyright 20.2.1+ds1-1/debian/copyright
--- 19.7.13+ds1-1/debian/copyright	2022-04-21 08:52:58.000000000 +0000
+++ 20.2.1+ds1-1/debian/copyright	2022-08-04 09:56:59.000000000 +0000
@@ -1,5 +1,5 @@
 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: pvr.zatoo
+Upstream-Name: pvr.zattoo
 Source: https://github.com/rbuehlma/pvr.zattoo
 Files-Excluded: depends
 
diff -pruN 19.7.13+ds1-1/debian/watch 20.2.1+ds1-1/debian/watch
--- 19.7.13+ds1-1/debian/watch	2021-08-26 10:44:13.000000000 +0000
+++ 20.2.1+ds1-1/debian/watch	2022-08-04 09:56:59.000000000 +0000
@@ -5,4 +5,4 @@ opts="repack, \
       repacksuffix=+ds1, \
       dversionmangle=auto" \
 https://github.com/rbuehlma/pvr.zattoo/releases \
-/rbuehlma/pvr.zattoo/archive/refs/tags/?(\d\S*)-Matrix\.tar\.gz
+/rbuehlma/pvr.zattoo/archive/refs/tags/?(\d\S*)-Nexus\.tar\.gz
diff -pruN 19.7.13+ds1-1/.github/workflows/build.yml 20.2.1+ds1-1/.github/workflows/build.yml
--- 19.7.13+ds1-1/.github/workflows/build.yml	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/.github/workflows/build.yml	2022-01-02 17:18:23.000000000 +0000
@@ -18,23 +18,23 @@ jobs:
         - os: ubuntu-18.04
           CC: gcc
           CXX: g++
-        - os: ubuntu-18.04
-          CC: clang
-          CXX: clang++
-        - os: macos-10.15
+        #- os: ubuntu-18.04
+          #CC: clang
+          #CXX: clang++
+        #- os: macos-10.15
     steps:
     - name: Install needed ubuntu depends
       env:
         DEBIAN_BUILD: ${{ matrix.DEBIAN_BUILD }}
       run: |
-        if [[ $DEBIAN_BUILD == true ]]; then sudo add-apt-repository -y ppa:team-xbmc/ppa; fi
+        if [[ $DEBIAN_BUILD == true ]]; then sudo add-apt-repository -y ppa:team-xbmc/xbmc-nightly; fi
         if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get update; fi
         if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get install fakeroot; fi
     - name: Checkout Kodi repo
       uses: actions/checkout@v2
       with:
         repository: xbmc/xbmc
-        ref: Matrix
+        ref: master
         path: xbmc
     - name: Checkout pvr.zattoo repo
       uses: actions/checkout@v2
@@ -48,7 +48,7 @@ jobs:
       run: |
         if [[ $DEBIAN_BUILD != true ]]; then cd ${app_id} && mkdir -p build && cd build; fi
         if [[ $DEBIAN_BUILD != true ]]; then cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/xbmc/addons -DPACKAGE_ZIP=1 ${{ github.workspace }}/xbmc/cmake/addons; fi
-        if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/Matrix/xbmc/addons/kodi-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi
+        if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/master/xbmc/addons/kodi-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi
         if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get build-dep ${{ github.workspace }}/${app_id}; fi
     - name: Build
       env:
diff -pruN 19.7.13+ds1-1/Jenkinsfile 20.2.1+ds1-1/Jenkinsfile
--- 19.7.13+ds1-1/Jenkinsfile	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/Jenkinsfile	2022-01-02 17:18:23.000000000 +0000
@@ -1 +1 @@
-buildPlugin(version: "Matrix")
+buildPlugin(version: "Nexus")
diff -pruN 19.7.13+ds1-1/pvr.zattoo/addon.xml.in 20.2.1+ds1-1/pvr.zattoo/addon.xml.in
--- 19.7.13+ds1-1/pvr.zattoo/addon.xml.in	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/pvr.zattoo/addon.xml.in	2022-01-02 17:18:23.000000000 +0000
@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <addon id="pvr.zattoo"
-       version="19.7.13"
+       version="20.2.1"
        name="Zattoo PVR Client"
        provider-name="trummerjo,rbuehlma">
   <requires>
     @ADDON_DEPENDS@
     <import addon="inputstream.adaptive" minversion="2.4.2"/>
-    <import addon="script.module.inputstreamhelper" version="0.5.8"/>
   </requires>
   <extension point="kodi.pvrclient" library_@PLATFORM@="@LIBRARY_FILENAME@"/>
   <extension point="xbmc.addon.metadata">
@@ -21,10 +20,10 @@
     <description lang="en_NZ">Zattoo frontend; supporting streaming of Live TV &amp; Recordings, EPG, Timers</description>
     <description lang="en_US">Zattoo frontend; supporting streaming of Live TV &amp; Recordings, EPG, Timers</description>
     <disclaimer lang="de_DE">Die Autoren sind in keiner Weise verantwortlich für fehlgeschlagene Aufnahmen, falsche Timer, verschwendete Zeit oder andere ungewünschte Effekte.</disclaimer>
-    <disclaimer lang="en_AU">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects..</disclaimer>
-    <disclaimer lang="en_GB">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects..</disclaimer>
-    <disclaimer lang="en_NZ">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects..</disclaimer>
-    <disclaimer lang="en_US">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects..</disclaimer>
+    <disclaimer lang="en_AU">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects.</disclaimer>
+    <disclaimer lang="en_GB">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects.</disclaimer>
+    <disclaimer lang="en_NZ">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects.</disclaimer>
+    <disclaimer lang="en_US">The authors are in no way responsible for failed recordings, incorrect timers, wasted hours, or any other undesirable effects.</disclaimer>
     <platform>@PLATFORM@</platform>
     <license>GPL-2.0-or-later</license>
     <source>https://github.com/rbuehlma/pvr.zattoo</source>
@@ -32,470 +31,5 @@
       <icon>icon.png</icon>
       <fanart>fanart.jpg</fanart>
     </assets>
-    <news>
-v19.7.13
- - Refactor session handling
- - Revert: "Allow enabling/disabling directories for series recordings"
-v19.7.12
- - Allow enabling/disabling directories for series recordings
-v19.7.11
- - Put series recordings into directories
-v19.7.10
- - Return error if addon is not connected
-v19.7.9
- - Fix replay fallback if epg tag has changed
-v19.7.8
- - Fix concurrent access to list
-v19.7.7
- - Fix loading detailed epg information
-v19.7.6
- - Try to get current epg from Zattoo if replay fails
-v19.7.5
- - Do not load EPG for channels not listed
-v19.7.4
- - Load additional EPG information directly from Zattoo
- - Remove enhanced EPG provider
-v19.7.3
- - Remove support for XmlTV files
- - Support series recording
-v19.7.2
- - Fix duplicate requests
- - Trigger update after deleting timer and recording
- - Fix return status of deleting timer and recording
-v19.7.1
- - Fix HLS stream
-v19.7.0
- - Use Zattoo v3 API
- - Move addon data to sqlite db
- - Refactor loading EPG data
- - Fix loading app token
-v19.6.1
- - Fix timeshift for regions without full replay
-v19.6.0
-- Update PVR API 7.1.0
-v19.5.1
- - Rebuild
-v19.5.0
- - Update PVR API 7.0.2
-v19.4.4
- - Improve session re-init
-v19.4.3
-- Remove p8 from debian control file
-v19.4.2
- - Remove p8-platform dependency
- - Use std::thread
- - Fix char buffer delete
- - Use std:mutex
- - Remove unused p8-platform headers
-v19.4.1
- - Fix replay
-v19.4.0
- - Update PVR API 7.0.0
- - Major changes to match new API
-v19.3.2
- - Support receiving app token from html and json
-v19.3.1
- - Fix receiving app token required for login
-v19.3.0
- - Update PVR API 6.5.1
- - Update Global API 1.2.0
-v19.2.20
- - Update PVR API 6.5.0
-v19.2.19
- - Use Kodi filesystem to load xmltv file
-v19.2.18
- - Update PVR API 6.4.0
- - Correct license name on addon.xml
- - Minor cleanups
- - Add french categories
-v19.2.17
- - Warn missing categories only once
-v19.2.16
- - Fix Zattoo login
-v19.2.15
- - Rebuild of 19.2.14
-v19.2.14
- - Update PVR API 6.3.0
-v19.2.13
- - Update Debian build code
- - Minor cleanups
- - Add license name and source url to addon.xml
- - Add GPL2 license file and show GPL2 on README.md
-v19.2.12
- - Update PVR API 6.2.0
-v19.2.11
- - Do not show cache parse error if file has been removed
-v19.2.10
- - Fix login with credentials containing exclamation mark (!) in password
-v19.2.9
- - Add support for parental pin
- - Use selective recall flag by programme
-v19.2.8
- - Improve caching of epg data
-v19.2.7
- - Fix translations
- - Reduce number of update threads
- - Init update threads after login
-v19.2.6
- - Fix changelog in xml
-v19.2.5
- - Add inputstream.adaptive as dependency
- - Move changelog to addon metadata
-v19.2.4
- - Add option to disable Dolby
- - Improve update of recordings and timer
-v19.2.3
- - Support Dolby
-v19.2.2
- - Serialize sending EPG to Kodi.
-v19.2.1
- - Update cmake build system to Version 3.5
-v19.2.0
- - Recompile for 6.1.0 PVR Addon API compatibility
-v19.1.0
- - Update to GUI addon API v5.14.0
-v19.0.4
- - Fallback to country code if service region country is missing
-v19.0.3
- - Fix loading xmltv data
-v19.0.2
- - Improve loading xmltv file
-v19.0.1
- - Load description from xmltv file
-v19.0.0
- - Update to PVR addon API v6.0.0
-v18.1.22
- - Fix timeshift for regions without full replay
-v18.1.21
- - Improve session re-init
-v18.1.20
- - Same as v18.1.19
-v18.1.19
- - Support receiving app token from html and json
-v18.1.18
- - Fix receiving app token required for login
-v18.1.17
- - Use Kodi filesystem to load xmltv file
-v18.1.16
- - Warn missing categories only once
-v18.1.15
- - Fix Zattoo login
-v18.1.14
- - Do not show cache parse error if file has been removed
-v18.1.13
- - Fix login with credentials containing exclamation mark (!) in password
-v18.1.12
- - Add support for parental pin
- - Use selective recall flag by programme
-v18.1.11
- - Improve caching of epg data
-v18.1.10
- - Fix translations
- - Reduce number of update threads
- - Init update threads after login
-v18.1.9
- - Fix changelog in xml
-v18.1.8
- - Add inputstream.adaptive as dependency
- - Move changelog to addon metadata
-v18.1.7
- - Add option to disable Dolby
- - Improve update of recordings and timer
-v18.1.6
- - Support Dolby
-v18.1.5
- - Serialize sending EPG to Kodi.
-v18.1.4
- - Fallback to country code if service region country is missing
-v18.1.3
- - Fix loading xmltv data
-v18.1.2
- - Improve loading xmltv file
-v18.1.1
- - Load description from xmltv file
-v18.1.0
- - Support DASH widevine streams
-v18.0.68
- - Fix setting image url for epg
-v18.0.67
- - Fix image url for epg and recordings
-v18.0.66
- - Fix reseller configuration
-v18.0.65
- - Use TLS for external epg service
- - Inform that the zattoo session is provided to the epg service
-v18.0.64
- - Set genre before transferring timer
-v18.0.63
- - Add 1&amp;1 TV as reseller
-v18.0.62
- - Add swb TV as reseller
-v18.0.61
- - Add tinyxml2 as dependency (thanks to Rechi)
- - Cleanup c++ code (thanks to ksooo)
-v18.0.60
- - Support external xmltv files
-v18.0.59
- - Add tv.salt.ch as reseller
-v18.0.58
- - Fix uuid handling
-v18.0.57
- - Cleanup &amp; improvements (thanks to Currywurst)
-v18.0.56
- - Fix segmentation fault
- - Reduce log on level notice
-v18.0.55
- - Fix wrong null ptr check in GetRecordingLastPlayedPosition
-v18.0.54
- - Fix build with rapid json used by kodi
-v18.0.53
- - Fix loading details of more than 200 recordings
-v18.0.52
- - Fix loading detail recording data
-v18.0.51
- - Enable replay also for hls streams
-v18.0.50
- - Store app token in case it cannot be fetched from Zattoo
-v18.0.49
- - Fix error if no recordings are available
-v18.0.48
- - Update to PVR addon API v5.10.1
-v18.0.47
- - Fix deadlock due to missing mutex.unlock()
-v18.0.46
- - Fix loading recordings data
-v18.0.45
- - Use v4 login api
- - Improve logging
-v18.0.44
- - Update to PVR addon API v5.10.0
-v18.0.43
- - Improve handling of recordings
-v18.0.42
- - Do not drop recording state if recordings are not yet loaded
-v18.0.41
- - Store uuid after generating
-v18.0.40
- - Improve storing session cookie
-v18.0.39
- - Shorten session cookies in log
-v18.0.38
- - Persist Zattoo session
-v18.0.37
- - Cleanup cache also when recordings are not avialable
- - Provide addon version to Zattoo upon login
-v18.0.36
- - Seek 5 minutes into recording stream
-v18.0.35
- - Seek 5 minutes into replay stream
-v18.0.34
- - Use service region country for epg
-v18.0.33
- - Fix valgrind output
-v18.0.32
- - Cleanup due to merge in Kodi
-v18.0.31
- - Add quantum TV as reseller
-v18.0.30
- - Set mime type to prevent HEAD request
- - Enable manifest refresh
-v18.0.29
- - Support selective recall and restart
-v18.0.28
- - Revert "Allow playing current program from start without recall"
-v18.0.27
- - Disable playing future program
-v18.0.26
- - Allow playing current program from start without recall
-v18.0.25
- - Add some session information to log output
-v18.0.24
- - Sync time handling with pvr.teleboy
-v18.0.23
- - Add missing epg categories
-v18.0.22
- - Search for eit_categories.txt in system addon path
-v18.0.21
- - Search for logos in system addon path
-v18.0.20
- - Fix race conditions while closing the addon
-v18.0.19
- - Fix case where session is still alive while addon starts
- - Improve cache cleanup
- - Change some log levels
-v18.0.18
- - Fix time zone for EPG
-v18.0.17
- - Add some reseller
- -- netplus.tv
- -- mobiltv.quickline.com
- -- tvplus.m-net.de
- -- player.waly.tv
- -- meinewelt.cc
- -- bbv-tv.net
- -- vtxtv.ch
- -- myvisiontv.ch
- -- iptv.glattvision.ch
- -- saktv.ch
- -- nettv.netcologne.de
- -- tvonline.ewe.de
-v18.0.16
- - Make loading EPG multithreaded
-v18.0.15
- - Add debian folder
- - Remove tinyxml2
-v18.0.14
- - Fix crash when loading EPG
- - Fix selection of Quickline
-v18.0.13
- - Add support for Zattoo reseller (Quickline and Net+)
-v18.0.12
- - Improve EPG loading
-v18.0.11
- - Try to fix loading of guide
-v18.0.10
- - Rename GetFileProperty to GetFilePropertyValue
-v18.0.9
- - Fix build and solve warnings
-v18.0.8
- - Load EPG async
-v18.0.7
- - Replace libcurl with kodi implementation
- - Add cache to improve loading time of recordings and timer
-v18.0.6
- - Adapt to final pvr api 5.7.0
-v18.0.5
- - Fix exception when loading timer
-v18.0.4
- - Remove unused code
- - Reformat code
- - Replace libyajl with rapidjson
-v18.0.3
- - Implement new replay api
-v18.0.2
- - Allow selection between dash and hls stream
-v18.0.1
- - Adapt to new api
- - Merge dash branch into master
-v18.0.0
- - Initial support for Kodi 18 Leia
- - Added minimalistic support for PVR Addon API 5.3.0
-v0.2.11
- - Merge v0.1.32
-v0.2.10
- - Merge v0.1.31
-v0.2.9
- - Merge v0.1.30
-v0.2.8
- - Fix error upon installation without settings
-v0.2.7
- - Fix some minor memory leaks
- - Add new time-shift parameter to "watch" request
-v0.2.6
- - Merge v0.1.29
-v0.2.5
- - Merge v0.1.28
-v0.2.4
- - Merge v0.1.27
-v0.2.3
- - Merge v0.1.26
-v0.2.2
- - Merge v0.1.24
-v0.2.1
- - Temporary fix to show correct epg in case of replay
-v0.2.0
- - Enable DASH
- - Enable Seeking (may not work with current inputstream.mpd)
- - Enable recording of past shows
- - Enable RePlay-TV
- - Please note that this version requires a patched version of Kodi v17
-v0.1.33
- - Initial support for Kodi 18 Leia
- - Added minimalistic support for PVR Addon API 5.3.0
-v0.1.32
- - Implement alternative EPG service to speed up and include description
-v0.1.31
- - Refactor epg cache to solve memory issue
-v0.1.30
- - Fix error upon installation without settings
- - Fix memory leaks
- - Remove some unused code
- - Sync code with zattoo_dash branch where possible
-v0.1.29
- - Use libcurl to support https
-v0.1.28
- - Fix case where no genre is available
-v0.1.27
- - Map genre in guid
- - Add genre to recording and timer
- - Add plot to recording
-v0.1.26
- - Fix en_gb translations
- - Show channel name for recordings
-v0.1.25
- - URL-Encode username and password
-v0.1.24
- - New logo and fanart
- - Add LICENSE.txt
- - Add english translation
-v0.1.23
- - Adapt to new API version
-v0.1.22
- - Support resume time and watch count
-v0.1.21
- - Re-add own HTTP implementation to allow access to cookies
-v0.1.20
- - Do not store app token and uuid anymore as Kodi does not store cookies since v17 beta 3
-v0.1.19
- - Generate and store a unique UUID for every installation
- - Ignore if hello fails
-v0.1.18
- - Improve login handling
- - Re-init session if we get errors on loading pages
-v0.1.17
- - Update timers &amp; recordings every 10 minutes or if a timer has reacht its start time
-v0.1.16
- - Fix another memory leak
- - Add option to only load favorites
-v0.1.15
- - Fix memory leaks
-v0.1.14
- - Add channel logos to addon (thanks to yattaah)
-v0.1.13
- - Refactor login and session handling
-v0.1.12
- - Always check that json is returned
-v0.1.11
- - Reuse session if possible
-v0.1.10
- - Preserve application token
-v0.1.9
- - Revert to using hls stream
-v0.1.8
- - Fix initial load. Open settings dialog if required
-v0.1.7
- - Fix windows build
- - Make recordings visible in EPG timeline
-v0.1.6
- - Fix linking of libYajl for OSX (and maybe also for other environments)
-v0.1.5
- - Fix sorting of favourites by using the first n channel numbers for them
- - Offset the remaining channels by the number of favourites to prevent overlaps
-v0.1.4
- - Support deletion of timer (planned recording)
- - Refresh timers after change
-v0.1.3
- - Support creating timers (for recordings)
- - Support deletion of recordings
-v0.1.2
- - Support watching recordings
-v0.1.1
- - Replace own HTTP implementation with Curl from Kodi
-v0.1.0
- - Support Kodi v17
-v0.0.3
- - Favoriten werden nun geladen
- - Es werden nun so viele EPG Daten im vorraus geladen wie in Kodi eingestellt
-    </news>
   </extension>
 </addon>
diff -pruN 19.7.13+ds1-1/pvr.zattoo/changelog.txt 20.2.1+ds1-1/pvr.zattoo/changelog.txt
--- 19.7.13+ds1-1/pvr.zattoo/changelog.txt	1970-01-01 00:00:00.000000000 +0000
+++ 20.2.1+ds1-1/pvr.zattoo/changelog.txt	2022-01-02 17:18:23.000000000 +0000
@@ -0,0 +1,468 @@
+v20.2.1
+- Use rapidjson fd3dc29 on depends to become C++17 fixed
+v20.2.0
+- Kodi main API update to version 2.0.0
+v20.1.0
+- Kodi PVR API to 8.0.0
+  - Add supports recordings delete capability
+  - Enforce EDL limits
+v20.0.0
+ - Fix some compile warnings by depends build of rapidjson
+ - Cleanup language texts in strings.po and addon.xml
+ - Add german translation
+v19.7.10
+ - Return error if addon is not connected
+v19.7.9
+ - Fix replay fallback if epg tag has changed
+v19.7.8
+ - Fix concurrent access to list
+v19.7.7
+ - Fix loading detailed epg information
+v19.7.6
+ - Try to get current epg from Zattoo if replay fails
+v19.7.5
+ - Do not load EPG for channels not listed
+v19.7.4
+ - Load additional EPG information directly from Zattoo
+ - Remove enhanced EPG provider
+v19.7.3
+ - Remove support for XmlTV files
+ - Support series recording
+v19.7.2
+ - Fix duplicate requests
+ - Trigger update after deleting timer and recording
+ - Fix return status of deleting timer and recording
+v19.7.1
+ - Fix HLS stream
+v19.7.0
+ - Use Zattoo v3 API
+ - Move addon data to sqlite db
+ - Refactor loading EPG data
+ - Fix loading app token
+v19.6.1
+ - Fix timeshift for regions without full replay
+v19.6.0
+- Update PVR API 7.1.0
+v19.5.1
+ - Rebuild
+v19.5.0
+ - Update PVR API 7.0.2
+v19.4.4
+ - Improve session re-init
+v19.4.3
+- Remove p8 from debian control file
+v19.4.2
+ - Remove p8-platform dependency
+ - Use std::thread
+ - Fix char buffer delete
+ - Use std:mutex
+ - Remove unused p8-platform headers
+v19.4.1
+ - Fix replay
+v19.4.0
+ - Update PVR API 7.0.0
+ - Major changes to match new API
+v19.3.2
+ - Support receiving app token from html and json
+v19.3.1
+ - Fix receiving app token required for login
+v19.3.0
+ - Update PVR API 6.5.1
+ - Update Global API 1.2.0
+v19.2.20
+ - Update PVR API 6.5.0
+v19.2.19
+ - Use Kodi filesystem to load xmltv file
+v19.2.18
+ - Update PVR API 6.4.0
+ - Correct license name on addon.xml
+ - Minor cleanups
+ - Add french categories
+v19.2.17
+ - Warn missing categories only once
+v19.2.16
+ - Fix Zattoo login
+v19.2.15
+ - Rebuild of 19.2.14
+v19.2.14
+ - Update PVR API 6.3.0
+v19.2.13
+ - Update Debian build code
+ - Minor cleanups
+ - Add license name and source url to addon.xml
+ - Add GPL2 license file and show GPL2 on README.md
+v19.2.12
+ - Update PVR API 6.2.0
+v19.2.11
+ - Do not show cache parse error if file has been removed
+v19.2.10
+ - Fix login with credentials containing exclamation mark (!) in password
+v19.2.9
+ - Add support for parental pin
+ - Use selective recall flag by programme
+v19.2.8
+ - Improve caching of epg data
+v19.2.7
+ - Fix translations
+ - Reduce number of update threads
+ - Init update threads after login
+v19.2.6
+ - Fix changelog in xml
+v19.2.5
+ - Add inputstream.adaptive as dependency
+ - Move changelog to addon metadata
+v19.2.4
+ - Add option to disable Dolby
+ - Improve update of recordings and timer
+v19.2.3
+ - Support Dolby
+v19.2.2
+ - Serialize sending EPG to Kodi.
+v19.2.1
+ - Update cmake build system to Version 3.5
+v19.2.0
+ - Recompile for 6.1.0 PVR Addon API compatibility
+v19.1.0
+ - Update to GUI addon API v5.14.0
+v19.0.4
+ - Fallback to country code if service region country is missing
+v19.0.3
+ - Fix loading xmltv data
+v19.0.2
+ - Improve loading xmltv file
+v19.0.1
+ - Load description from xmltv file
+v19.0.0
+ - Update to PVR addon API v6.0.0
+v18.1.22
+ - Fix timeshift for regions without full replay
+v18.1.21
+ - Improve session re-init
+v18.1.20
+ - Same as v18.1.19
+v18.1.19
+ - Support receiving app token from html and json
+v18.1.18
+ - Fix receiving app token required for login
+v18.1.17
+ - Use Kodi filesystem to load xmltv file
+v18.1.16
+ - Warn missing categories only once
+v18.1.15
+ - Fix Zattoo login
+v18.1.14
+ - Do not show cache parse error if file has been removed
+v18.1.13
+ - Fix login with credentials containing exclamation mark (!) in password
+v18.1.12
+ - Add support for parental pin
+ - Use selective recall flag by programme
+v18.1.11
+ - Improve caching of epg data
+v18.1.10
+ - Fix translations
+ - Reduce number of update threads
+ - Init update threads after login
+v18.1.9
+ - Fix changelog in xml
+v18.1.8
+ - Add inputstream.adaptive as dependency
+ - Move changelog to addon metadata
+v18.1.7
+ - Add option to disable Dolby
+ - Improve update of recordings and timer
+v18.1.6
+ - Support Dolby
+v18.1.5
+ - Serialize sending EPG to Kodi.
+v18.1.4
+ - Fallback to country code if service region country is missing
+v18.1.3
+ - Fix loading xmltv data
+v18.1.2
+ - Improve loading xmltv file
+v18.1.1
+ - Load description from xmltv file
+v18.1.0
+ - Support DASH widevine streams
+v18.0.68
+ - Fix setting image url for epg
+v18.0.67
+ - Fix image url for epg and recordings
+v18.0.66
+ - Fix reseller configuration
+v18.0.65
+ - Use TLS for external epg service
+ - Inform that the zattoo session is provided to the epg service
+v18.0.64
+ - Set genre before transferring timer
+v18.0.63
+ - Add 1&amp;1 TV as reseller
+v18.0.62
+ - Add swb TV as reseller
+v18.0.61
+ - Add tinyxml2 as dependency (thanks to Rechi)
+ - Cleanup c++ code (thanks to ksooo)
+v18.0.60
+ - Support external xmltv files
+v18.0.59
+ - Add tv.salt.ch as reseller
+v18.0.58
+ - Fix uuid handling
+v18.0.57
+ - Cleanup &amp; improvements (thanks to Currywurst)
+v18.0.56
+ - Fix segmentation fault
+ - Reduce log on level notice
+v18.0.55
+ - Fix wrong null ptr check in GetRecordingLastPlayedPosition
+v18.0.54
+ - Fix build with rapid json used by kodi
+v18.0.53
+ - Fix loading details of more than 200 recordings
+v18.0.52
+ - Fix loading detail recording data
+v18.0.51
+ - Enable replay also for hls streams
+v18.0.50
+ - Store app token in case it cannot be fetched from Zattoo
+v18.0.49
+ - Fix error if no recordings are available
+v18.0.48
+ - Update to PVR addon API v5.10.1
+v18.0.47
+ - Fix deadlock due to missing mutex.unlock()
+v18.0.46
+ - Fix loading recordings data
+v18.0.45
+ - Use v4 login api
+ - Improve logging
+v18.0.44
+ - Update to PVR addon API v5.10.0
+v18.0.43
+ - Improve handling of recordings
+v18.0.42
+ - Do not drop recording state if recordings are not yet loaded
+v18.0.41
+ - Store uuid after generating
+v18.0.40
+ - Improve storing session cookie
+v18.0.39
+ - Shorten session cookies in log
+v18.0.38
+ - Persist Zattoo session
+v18.0.37
+ - Cleanup cache also when recordings are not avialable
+ - Provide addon version to Zattoo upon login
+v18.0.36
+ - Seek 5 minutes into recording stream
+v18.0.35
+ - Seek 5 minutes into replay stream
+v18.0.34
+ - Use service region country for epg
+v18.0.33
+ - Fix valgrind output
+v18.0.32
+ - Cleanup due to merge in Kodi
+v18.0.31
+ - Add quantum TV as reseller
+v18.0.30
+ - Set mime type to prevent HEAD request
+ - Enable manifest refresh
+v18.0.29
+ - Support selective recall and restart
+v18.0.28
+ - Revert "Allow playing current program from start without recall"
+v18.0.27
+ - Disable playing future program
+v18.0.26
+ - Allow playing current program from start without recall
+v18.0.25
+ - Add some session information to log output
+v18.0.24
+ - Sync time handling with pvr.teleboy
+v18.0.23
+ - Add missing epg categories
+v18.0.22
+ - Search for eit_categories.txt in system addon path
+v18.0.21
+ - Search for logos in system addon path
+v18.0.20
+ - Fix race conditions while closing the addon
+v18.0.19
+ - Fix case where session is still alive while addon starts
+ - Improve cache cleanup
+ - Change some log levels
+v18.0.18
+ - Fix time zone for EPG
+v18.0.17
+ - Add some reseller
+ -- netplus.tv
+ -- mobiltv.quickline.com
+ -- tvplus.m-net.de
+ -- player.waly.tv
+ -- meinewelt.cc
+ -- bbv-tv.net
+ -- vtxtv.ch
+ -- myvisiontv.ch
+ -- iptv.glattvision.ch
+ -- saktv.ch
+ -- nettv.netcologne.de
+ -- tvonline.ewe.de
+v18.0.16
+ - Make loading EPG multithreaded
+v18.0.15
+ - Add debian folder
+ - Remove tinyxml2
+v18.0.14
+ - Fix crash when loading EPG
+ - Fix selection of Quickline
+v18.0.13
+ - Add support for Zattoo reseller (Quickline and Net+)
+v18.0.12
+ - Improve EPG loading
+v18.0.11
+ - Try to fix loading of guide
+v18.0.10
+ - Rename GetFileProperty to GetFilePropertyValue
+v18.0.9
+ - Fix build and solve warnings
+v18.0.8
+ - Load EPG async
+v18.0.7
+ - Replace libcurl with kodi implementation
+ - Add cache to improve loading time of recordings and timer
+v18.0.6
+ - Adapt to final pvr api 5.7.0
+v18.0.5
+ - Fix exception when loading timer
+v18.0.4
+ - Remove unused code
+ - Reformat code
+ - Replace libyajl with rapidjson
+v18.0.3
+ - Implement new replay api
+v18.0.2
+ - Allow selection between dash and hls stream
+v18.0.1
+ - Adapt to new api
+ - Merge dash branch into master
+v18.0.0
+ - Initial support for Kodi 18 Leia
+ - Added minimalistic support for PVR Addon API 5.3.0
+v0.2.11
+ - Merge v0.1.32
+v0.2.10
+ - Merge v0.1.31
+v0.2.9
+ - Merge v0.1.30
+v0.2.8
+ - Fix error upon installation without settings
+v0.2.7
+ - Fix some minor memory leaks
+ - Add new time-shift parameter to "watch" request
+v0.2.6
+ - Merge v0.1.29
+v0.2.5
+ - Merge v0.1.28
+v0.2.4
+ - Merge v0.1.27
+v0.2.3
+ - Merge v0.1.26
+v0.2.2
+ - Merge v0.1.24
+v0.2.1
+ - Temporary fix to show correct epg in case of replay
+v0.2.0
+ - Enable DASH
+ - Enable Seeking (may not work with current inputstream.mpd)
+ - Enable recording of past shows
+ - Enable RePlay-TV
+ - Please note that this version requires a patched version of Kodi v17
+v0.1.33
+ - Initial support for Kodi 18 Leia
+ - Added minimalistic support for PVR Addon API 5.3.0
+v0.1.32
+ - Implement alternative EPG service to speed up and include description
+v0.1.31
+ - Refactor epg cache to solve memory issue
+v0.1.30
+ - Fix error upon installation without settings
+ - Fix memory leaks
+ - Remove some unused code
+ - Sync code with zattoo_dash branch where possible
+v0.1.29
+ - Use libcurl to support https
+v0.1.28
+ - Fix case where no genre is available
+v0.1.27
+ - Map genre in guid
+ - Add genre to recording and timer
+ - Add plot to recording
+v0.1.26
+ - Fix en_gb translations
+ - Show channel name for recordings
+v0.1.25
+ - URL-Encode username and password
+v0.1.24
+ - New logo and fanart
+ - Add LICENSE.txt
+ - Add english translation
+v0.1.23
+ - Adapt to new API version
+v0.1.22
+ - Support resume time and watch count
+v0.1.21
+ - Re-add own HTTP implementation to allow access to cookies
+v0.1.20
+ - Do not store app token and uuid anymore as Kodi does not store cookies since v17 beta 3
+v0.1.19
+ - Generate and store a unique UUID for every installation
+ - Ignore if hello fails
+v0.1.18
+ - Improve login handling
+ - Re-init session if we get errors on loading pages
+v0.1.17
+ - Update timers &amp; recordings every 10 minutes or if a timer has reacht its start time
+v0.1.16
+ - Fix another memory leak
+ - Add option to only load favorites
+v0.1.15
+ - Fix memory leaks
+v0.1.14
+ - Add channel logos to addon (thanks to yattaah)
+v0.1.13
+ - Refactor login and session handling
+v0.1.12
+ - Always check that json is returned
+v0.1.11
+ - Reuse session if possible
+v0.1.10
+ - Preserve application token
+v0.1.9
+ - Revert to using hls stream
+v0.1.8
+ - Fix initial load. Open settings dialog if required
+v0.1.7
+ - Fix windows build
+ - Make recordings visible in EPG timeline
+v0.1.6
+ - Fix linking of libYajl for OSX (and maybe also for other environments)
+v0.1.5
+ - Fix sorting of favourites by using the first n channel numbers for them
+ - Offset the remaining channels by the number of favourites to prevent overlaps
+v0.1.4
+ - Support deletion of timer (planned recording)
+ - Refresh timers after change
+v0.1.3
+ - Support creating timers (for recordings)
+ - Support deletion of recordings
+v0.1.2
+ - Support watching recordings
+v0.1.1
+ - Replace own HTTP implementation with Curl from Kodi
+v0.1.0
+ - Support Kodi v17
+v0.0.3
+ - Favoriten werden nun geladen
+ - Es werden nun so viele EPG Daten im vorraus geladen wie in Kodi eingestellt
diff -pruN 19.7.13+ds1-1/pvr.zattoo/resources/language/resource.language.de_de/strings.po 20.2.1+ds1-1/pvr.zattoo/resources/language/resource.language.de_de/strings.po
--- 19.7.13+ds1-1/pvr.zattoo/resources/language/resource.language.de_de/strings.po	1970-01-01 00:00:00.000000000 +0000
+++ 20.2.1+ds1-1/pvr.zattoo/resources/language/resource.language.de_de/strings.po	2022-01-02 17:18:23.000000000 +0000
@@ -0,0 +1,223 @@
+# Kodi Media Center language file
+# Addon Name: pvr.zattoo
+# Addon id: pvr.zattoo
+# Addon Provider: trummerjo
+
+msgid ""
+msgstr ""
+
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: en\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. Setting to set used stream username
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30000"
+msgid "Username"
+msgstr "Benutzername"
+
+#. Setting to set used stream password
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30001"
+msgid "Password"
+msgstr "Passwort"
+
+#. Boolean setting to use favourite streams only
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30002"
+msgid "Favourite channels only"
+msgstr "Nur favorisierte Kanäle nutzen"
+
+#. Help text to setting #30002
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30003"
+msgid "Load only channels which are in the favourite list."
+msgstr "Lädt nur Kanäle welche in favorisierter Liste enthalten sind."
+
+#. Selection spinner on settings to get wanted stream type
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30004"
+msgid "Stream type"
+msgstr "Stream-Typ"
+
+#. Help text to setting #30004
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30005"
+msgid "To select wanted encrypted stream type."
+msgstr "Um den gewünschten verschlüsselten Stream-Typ auszuwählen."
+
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30006"
+msgid "dash"
+msgstr "dash"
+
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30007"
+msgid "hls"
+msgstr "hls"
+
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30008"
+msgid "dash_widevine"
+msgstr "dash_widevine"
+
+#. Text setting to set used parental pin
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30009"
+msgid "Parental pin"
+msgstr "Pin zur Kindersicherung"
+
+#. Boolean setting to enable dolby stream usage
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30010"
+msgid "Enable Dolby"
+msgstr "Aktiviere Dolby"
+
+#. Help text to setting #30010
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30011"
+msgid "Enable support for dolby."
+msgstr "Aktiviert die Unterstützung für Dolby Streams."
+
+#. Settings category label
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30014"
+msgid "Zattoo"
+msgstr "Zattoo"
+
+#. Settings group label
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30015"
+msgid "General"
+msgstr "Allgemein"
+
+#. Selection list on settings to get wanted stream provider
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30098"
+msgid "Provider"
+msgstr "Anbieter"
+
+#. Help text to setting #30098
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30099"
+msgid "The stream provider to use with this addon."
+msgstr "Der Stream-Anbieter, der mit diesem Add-On verwendet werden soll."
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30100"
+msgid "Zattoo"
+msgstr "Zattoo"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30101"
+msgid "Netplus"
+msgstr "Netplus"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30102"
+msgid "Quickline"
+msgstr "Quickline"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30103"
+msgid "m-net"
+msgstr "m-net"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30104"
+msgid "WALY.TV"
+msgstr "WALY.TV"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30105"
+msgid "meinewelt.cc"
+msgstr "meinewelt.cc"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30106"
+msgid "BBV-tv.net"
+msgstr "BBV-tv.net"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30107"
+msgid "VTXtv.ch"
+msgstr "VTXtv.ch"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30108"
+msgid "myvisiontv.ch"
+msgstr "myvisiontv.ch"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30109"
+msgid "GLATTvision.ch"
+msgstr "GLATTvision.ch"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30110"
+msgid "SAKtv.ch"
+msgstr "SAKtv.ch"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30111"
+msgid "NetCologne"
+msgstr "NetCologne"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30112"
+msgid "EWE.de"
+msgstr "EWE.de"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30113"
+msgid "quantum TV"
+msgstr "quantum TV"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30114"
+msgid "Salt.ch"
+msgstr "Salt.ch"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30115"
+msgid "swb TV"
+msgstr "swb TV"
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30116"
+msgid "1&1 TV"
+msgstr "1&1 TV"
+
+#. Notification message to show on screen if username or password not set
+#: src/client.cpp
+msgctxt "#30200"
+msgid "Missing username or password"
+msgstr "Fehlender Benutzername oder Passwort"
+
+#. Fail message (string currently not used on addon)
+msgctxt "#30201"
+msgid "Login failed!"
+msgstr "Anmeldung fehlgeschlagen!"
+
diff -pruN 19.7.13+ds1-1/pvr.zattoo/resources/language/resource.language.en_gb/strings.po 20.2.1+ds1-1/pvr.zattoo/resources/language/resource.language.en_gb/strings.po
--- 19.7.13+ds1-1/pvr.zattoo/resources/language/resource.language.en_gb/strings.po	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/pvr.zattoo/resources/language/resource.language.en_gb/strings.po	2022-01-02 17:18:23.000000000 +0000
@@ -12,135 +12,212 @@ msgstr ""
 "Language: en\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
+#. Setting to set used stream username
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30000"
 msgid "Username"
 msgstr ""
 
+#. Setting to set used stream password
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30001"
 msgid "Password"
 msgstr ""
 
+#. Boolean setting to use favourite streams only
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30002"
 msgid "Favourite channels only"
-msgstr "Load only channels which are in the favourite list"
+msgstr ""
 
+#. Help text to setting #30002
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30003"
-msgid "Stream type"
-msgstr "The stream type"
+msgid "Load only channels which are in the favourite list."
+msgstr ""
 
+#. Selection spinner on settings to get wanted stream type
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30004"
-msgid "dash"
+msgid "Stream type"
 msgstr ""
 
+#. Help text to setting #30004
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30005"
-msgid "hls"
+msgid "To select wanted encrypted stream type."
 msgstr ""
 
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30006"
-msgid "dash_widevine"
+msgid "dash"
 msgstr ""
 
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30007"
+msgid "hls"
+msgstr ""
+
+#. Selection value for setting defined with id #30004
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30008"
+msgid "dash_widevine"
+msgstr ""
+
+#. Text setting to set used parental pin
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30009"
 msgid "Parental pin"
-msgstr "Parental pin"
+msgstr ""
 
+#. Boolean setting to enable dolby stream usage
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30010"
 msgid "Enable Dolby"
-msgstr "Enable support for dolby"
+msgstr ""
+
+#. Help text to setting #30010
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30011"
+msgid "Enable support for dolby."
+msgstr ""
 
+#. Settings category label
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30014"
 msgid "Zattoo"
 msgstr ""
 
+#. Settings group label
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30015"
 msgid "General"
 msgstr ""
 
-msgctxt "#30099"
+#. Selection list on settings to get wanted stream provider
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30098"
 msgid "Provider"
-msgstr "The provider of the Zattoo service"
+msgstr ""
 
+#. Help text to setting #30098
+#: pvr.zattoo/resources/settings.xml
+msgctxt "#30099"
+msgid "The stream provider to use with this addon."
+msgstr ""
+
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30100"
 msgid "Zattoo"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30101"
 msgid "Netplus"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30102"
 msgid "Quickline"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30103"
 msgid "m-net"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30104"
 msgid "WALY.TV"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30105"
 msgid "meinewelt.cc"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30106"
 msgid "BBV-tv.net"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30107"
 msgid "VTXtv.ch"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30108"
 msgid "myvisiontv.ch"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30109"
 msgid "GLATTvision.ch"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30110"
 msgid "SAKtv.ch"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30111"
 msgid "NetCologne"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30112"
 msgid "EWE.de"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30113"
 msgid "quantum TV"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30114"
 msgid "Salt.ch"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30115"
 msgid "swb TV"
 msgstr ""
 
+#. Selection value for setting defined with id #30099
+#: pvr.zattoo/resources/settings.xml
 msgctxt "#30116"
 msgid "1&1 TV"
 msgstr ""
 
+#. Notification message to show on screen if username or password not set
+#: src/client.cpp
 msgctxt "#30200"
 msgid "Missing username or password"
-msgstr "Missing username or password"
+msgstr ""
 
+#. Fail message (string currently not used on addon)
 msgctxt "#30201"
 msgid "Login failed!"
-msgstr "Login failed!"
-
-msgctxt "#30202"
-msgid "Connected"
-msgstr ""
-
-msgctxt "#30203"
-msgid "Server not reachable!"
 msgstr ""
 
diff -pruN 19.7.13+ds1-1/pvr.zattoo/resources/settings.xml 20.2.1+ds1-1/pvr.zattoo/resources/settings.xml
--- 19.7.13+ds1-1/pvr.zattoo/resources/settings.xml	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/pvr.zattoo/resources/settings.xml	2022-01-02 17:18:23.000000000 +0000
@@ -22,29 +22,29 @@
             <hidden>true</hidden>
           </control>
         </setting>
-        <setting id="favoritesonly" type="boolean" label="30002">
+        <setting id="favoritesonly" type="boolean" label="30002" help="30003">
           <level>0</level>
           <default>false</default>
           <control type="toggle" />
         </setting>
-        <setting id="streamtype" type="integer" label="30003">
+        <setting id="streamtype" type="integer" label="30004" help="30005">
           <level>0</level>
           <default>0</default>
           <constraints>
             <options>
-              <option label="30004">0</option> <!-- dash -->
-              <option label="30005">1</option> <!-- hls -->
-              <option label="30006">2</option> <!-- dash_widevine -->
+              <option label="30006">0</option> <!-- dash -->
+              <option label="30007">1</option> <!-- hls -->
+              <option label="30008">2</option> <!-- dash_widevine -->
             </options>
           </constraints>
           <control type="spinner" format="integer" />
 		</setting>
-		<setting id="enableDolby" type="boolean" label="30010">
+		<setting id="enableDolby" type="boolean" label="30010" help="30011">
           <level>0</level>
           <default>true</default>
           <control type="toggle" />
         </setting>
-        <setting id="provider" type="integer" label="30099">
+        <setting id="provider" type="integer" label="30098" help="30099">
           <level>0</level>
           <default>0</default>
           <constraints>
@@ -70,7 +70,7 @@
           </constraints>
           <control type="list" format="integer" />
 		</setting>
-        <setting id="parentalPin" type="string" label="30007">
+        <setting id="parentalPin" type="string" label="30009">
           <level>0</level>
           <default></default>
           <constraints>
diff -pruN 19.7.13+ds1-1/README.md 20.2.1+ds1-1/README.md
--- 19.7.13+ds1-1/README.md	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/README.md	2022-01-02 17:18:23.000000000 +0000
@@ -1,5 +1,6 @@
 [![License: GPL-2.0-or-later](https://img.shields.io/badge/License-GPL%20v2+-blue.svg)](LICENSE.md)
-[![Build Status](https://jenkins.kodi.tv/view/Addons/job/rbuehlma/job/pvr.zattoo/job/Matrix/badge/icon)](https://jenkins.kodi.tv/blue/organizations/jenkins/rbuehlma%2Fpvr.zattoo/branches/)
+[![Build and run tests](https://github.com/rbuehlma/pvr.zattoo/actions/workflows/build.yml/badge.svg?branch=Nexus)](https://github.com/rbuehlma/pvr.zattoo/actions/workflows/build.yml)
+[![Build Status](https://jenkins.kodi.tv/view/Addons/job/rbuehlma/job/pvr.zattoo/job/Nexus/badge/icon)](https://jenkins.kodi.tv/blue/organizations/jenkins/rbuehlma%2Fpvr.zattoo/branches/)
 
 # Zattoo PVR addon for Kodi
 
@@ -8,7 +9,7 @@ This is a [Kodi](https://kodi.tv) PVR ad
 ## Build instructions
 
 1. `git clone --branch master https://github.com/xbmc/xbmc`
-2. `git clone https://github.com/rbuehlma/pvr.zattoo`
+2. `git clone --branch Nexus https://github.com/rbuehlma/pvr.zattoo`
 3. `cd pvr.zattoo && mkdir build && cd build`
 4. `cmake -DADDONS_TO_BUILD=pvr.zattoo -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons`
 5. `make package-pvr.zattoo`
diff -pruN 19.7.13+ds1-1/src/categories.cpp 20.2.1+ds1-1/src/categories.cpp
--- 19.7.13+ds1-1/src/categories.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/categories.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -21,7 +21,7 @@
  */
 
 #include "categories.h"
-#include <kodi/AddonBase.h>
+#include "client.h"
 #include <cstring>
 #include <iostream>
 #include <kodi/Filesystem.h>
diff -pruN 19.7.13+ds1-1/src/client.cpp 20.2.1+ds1-1/src/client.cpp
--- 19.7.13+ds1-1/src/client.cpp	1970-01-01 00:00:00.000000000 +0000
+++ 20.2.1+ds1-1/src/client.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -0,0 +1,55 @@
+#include "client.h"
+
+#include "ZatData.h"
+
+#include <kodi/General.h>
+
+ADDON_STATUS CZattooTVAddon::CreateInstance(const kodi::addon::IInstanceInfo& instance,
+                                            KODI_ADDON_INSTANCE_HDL& hdl)
+{
+  if (instance.IsType(ADDON_INSTANCE_PVR))
+  {
+    m_settings.Load();
+
+    if (m_settings.GetZatUsername().empty() || m_settings.GetZatPassword().empty())
+    {
+      kodi::Log(ADDON_LOG_INFO, "Username or password not set.");
+      kodi::QueueNotification(QUEUE_WARNING, "", kodi::addon::GetLocalizedString(30200));
+      return ADDON_STATUS_NEED_SETTINGS;
+    }
+
+    kodi::Log(ADDON_LOG_DEBUG, "Create Zattoo");
+
+    std::string zatUsername = m_settings.GetZatUsername();
+    std::string zatPassword = m_settings.GetZatPassword();
+    bool zatFavoritesOnly = m_settings.GetZatFavoritesOnly();
+    STREAM_TYPE streamType = m_settings.GetStreamType();
+    bool zatEnableDolby = m_settings.GetZatEnableDolby();
+    int provider = m_settings.GetProvider();
+    std::string parentalPin = m_settings.GetParentalPin();
+
+    ZatData* client = new ZatData(instance, zatUsername, zatPassword, zatFavoritesOnly, streamType, zatEnableDolby, provider, parentalPin);
+    hdl = client;
+    kodi::Log(ADDON_LOG_DEBUG, "Zattoo created");
+
+    if (client->Initialize() && client->LoadChannels())
+    {
+      return ADDON_STATUS_OK;
+    }
+    else
+    {
+      kodi::QueueNotification(QUEUE_WARNING, "", kodi::addon::GetLocalizedString(37111));
+      return ADDON_STATUS_LOST_CONNECTION;
+    }
+  }
+
+  return ADDON_STATUS_UNKNOWN;
+}
+
+ADDON_STATUS CZattooTVAddon::SetSetting(const std::string& settingName,
+                                        const kodi::addon::CSettingValue& settingValue)
+{
+  return m_settings.SetSetting(settingName, settingValue);
+}
+
+ADDONCREATOR(CZattooTVAddon);
diff -pruN 19.7.13+ds1-1/src/client.h 20.2.1+ds1-1/src/client.h
--- 19.7.13+ds1-1/src/client.h	1970-01-01 00:00:00.000000000 +0000
+++ 20.2.1+ds1-1/src/client.h	2022-01-02 17:18:23.000000000 +0000
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "Settings.h"
+
+#include <kodi/AddonBase.h>
+#include <unordered_map>
+
+class ZatData;
+
+class ATTR_DLL_LOCAL CZattooTVAddon : public kodi::addon::CAddonBase
+{
+public:
+  CZattooTVAddon() = default;
+
+  ADDON_STATUS CreateInstance(const kodi::addon::IInstanceInfo& instance,
+                              KODI_ADDON_INSTANCE_HDL& hdl) override;
+
+  ADDON_STATUS SetSetting(const std::string& settingName,
+                          const kodi::addon::CSettingValue& settingValue) override;
+
+private:
+  CSettings m_settings;
+};
diff -pruN 19.7.13+ds1-1/src/epg/ZattooEpgProvider.cpp 20.2.1+ds1-1/src/epg/ZattooEpgProvider.cpp
--- 19.7.13+ds1-1/src/epg/ZattooEpgProvider.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/epg/ZattooEpgProvider.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,6 +1,6 @@
 #include "ZattooEpgProvider.h"
 #include "rapidjson/document.h"
-#include <kodi/AddonBase.h>
+#include "../client.h"
 #include "../Utils.h"
 #include <ctime>
 
diff -pruN 19.7.13+ds1-1/src/http/Cache.cpp 20.2.1+ds1-1/src/http/Cache.cpp
--- 19.7.13+ds1-1/src/http/Cache.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/http/Cache.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,5 +1,5 @@
-#include <kodi/AddonBase.h>
 #include "Cache.h"
+#include "../client.h"
 #include <kodi/Filesystem.h>
 #include "../Utils.h"
 #include "rapidjson/writer.h"
diff -pruN 19.7.13+ds1-1/src/http/HttpClient.cpp 20.2.1+ds1-1/src/http/HttpClient.cpp
--- 19.7.13+ds1-1/src/http/HttpClient.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/http/HttpClient.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -2,11 +2,11 @@
 #include "Cache.h"
 #include <random>
 #include "../md5.h"
-#include <kodi/AddonBase.h>
+#include "../client.h"
 
 static const std::string USER_AGENT = std::string("Kodi/")
     + std::string(STR(KODI_VERSION)) + std::string(" pvr.zattoo/")
-    + std::string(STR(ZATTOO_VERSION));
+    + std::string(STR(ZATTOO_VERSION)) + std::string(" (Kodi PVR addon)");
 
 HttpClient::HttpClient(ParameterDB *parameterDB):
   m_parameterDB(parameterDB)
@@ -126,9 +126,6 @@ std::string HttpClient::HttpRequest(cons
 
   if (statusCode >= 400 || statusCode < 200) {
     kodi::Log(ADDON_LOG_ERROR, "Open URL failed with %i.", statusCode);
-    if (m_statusCodeHandler != nullptr) {
-      m_statusCodeHandler->ErrorStatusCode(statusCode);
-    }
     return "";
   }
   std::string sessionId = curl.GetCookie("beaker.session.id");
diff -pruN 19.7.13+ds1-1/src/http/HttpClient.h 20.2.1+ds1-1/src/http/HttpClient.h
--- 19.7.13+ds1-1/src/http/HttpClient.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/http/HttpClient.h	2022-01-02 17:18:23.000000000 +0000
@@ -3,7 +3,6 @@
 
 #include "Curl.h"
 #include "../sql/ParameterDB.h"
-#include "HttpStatusCodeHandler.h"
 
 class HttpClient
 {
@@ -16,9 +15,6 @@ public:
   std::string HttpPost(const std::string& url, const std::string& postData, int &statusCode);
   void ClearSession();
   std::string GetUUID();
-   void SetStatusCodeHandler(HttpStatusCodeHandler* statusCodeHandler) {
-    m_statusCodeHandler = statusCodeHandler;
-  }
 private:
   std::string HttpRequest(const std::string& action, const std::string& url, const std::string& postData, int &statusCode);
   std::string HttpRequestToCurl(Curl &curl, const std::string& action, const std::string& url, const std::string& postData, int &statusCode);
@@ -27,7 +23,6 @@ private:
   std::string m_zattooSession;
   std::string m_uuid;
   ParameterDB *m_parameterDB;
-  HttpStatusCodeHandler *m_statusCodeHandler = nullptr;
 };
 
 #endif /* SRC_HTTP_HTTPCLIENT_H_ */
diff -pruN 19.7.13+ds1-1/src/http/HttpStatusCodeHandler.h 20.2.1+ds1-1/src/http/HttpStatusCodeHandler.h
--- 19.7.13+ds1-1/src/http/HttpStatusCodeHandler.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/http/HttpStatusCodeHandler.h	1970-01-01 00:00:00.000000000 +0000
@@ -1,13 +0,0 @@
-#ifndef SRC_HTTP_HTTPSTATUSCODEHANDLER_H_
-#define SRC_HTTP_HTTPSTATUSCODEHANDLER_H_
-
-
-class HttpStatusCodeHandler
-{
-    public:
-    virtual void ErrorStatusCode (int statusCode) {};
-    virtual ~HttpStatusCodeHandler() {};
-};
-
-
-#endif /* SRC_HTTP_HTTPSTATUSCODEHANDLER_H_ */
diff -pruN 19.7.13+ds1-1/src/Session.cpp 20.2.1+ds1-1/src/Session.cpp
--- 19.7.13+ds1-1/src/Session.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/Session.cpp	1970-01-01 00:00:00.000000000 +0000
@@ -1,318 +0,0 @@
-#include "Session.h"
-#include <kodi/AddonBase.h>
-#include <kodi/General.h>
-#include "ZatData.h"
-#include "rapidjson/document.h"
-
-using namespace rapidjson;
-
-Session::Session(HttpClient* httpClient, ZatData* zatData, CSettings* settings, ParameterDB *parameterDB):
-  m_httpClient(httpClient),
-  m_zatData(zatData),
-  m_settings(settings),
-  m_parameterDB(parameterDB)
-{
-  SetProviderUrl();
-}
-
-Session::~Session()
-{
-  m_running = false;
-  if (m_thread.joinable())
-    m_thread.join();  
-}
-
-ADDON_STATUS Session::Start()
-{
-  if (!m_settings->VerifySettings()) {
-    return ADDON_STATUS_NEED_SETTINGS;
-  }
-  
-  m_running = true;
-  m_thread = std::thread([&] { LoginThread(); });
-  return ADDON_STATUS_OK;
-}
-
-void Session::LoginThread() {
-  while (m_running) {
-    
-    std::this_thread::sleep_for(std::chrono::milliseconds(500));
-    
-    if (m_isConnected) {
-      continue;
-    }
-    
-    if (m_nextLoginAttempt > std::time(0)) {
-      continue;
-    }
-    
-    m_zatData->UpdateConnectionState("Zattoo Connecting", PVR_CONNECTION_STATE_CONNECTING, "");
-    
-    std::string username = m_settings->GetZatUsername();
-    std::string password = m_settings->GetZatPassword();
-    
-    kodi::Log(ADDON_LOG_DEBUG, "Login Zattoo");
-    if (Login(username, password))
-    {
-      if (!m_zatData->SessionInitialized()) {
-        m_nextLoginAttempt = std::time(0) + 60;
-        continue;
-      }
-      m_isConnected = true;
-      kodi::Log(ADDON_LOG_DEBUG, "Login done");
-      m_zatData->UpdateConnectionState("Zattoo connection established", PVR_CONNECTION_STATE_CONNECTED, "");
-      kodi::QueueNotification(QUEUE_INFO, "", kodi::GetLocalizedString(30202));      
-    }
-    else
-    {
-      kodi::Log(ADDON_LOG_ERROR, "Login failed");
-    }
-  }
-}
-
-bool Session::Login(std::string u, std::string p)
-{
-  
-  if (!LoadAppId())
-  {
-    Reset();
-    m_zatData->UpdateConnectionState("Failed to get appId", PVR_CONNECTION_STATE_SERVER_UNREACHABLE, kodi::GetLocalizedString(30203));
-    m_nextLoginAttempt = std::time(0) + 60;
-    return false;
-  }
-  
-  SendHello();
-  
-  int statusCode;
-  std::string jsonString = m_httpClient->HttpGet(m_providerUrl + "/zapi/v3/session", statusCode);
-  
-  if (statusCode != 200)
-  {
-    Reset();
-    m_zatData->UpdateConnectionState("Not reachable", PVR_CONNECTION_STATE_SERVER_UNREACHABLE, kodi::GetLocalizedString(30203));
-    m_nextLoginAttempt = std::time(0) + 60;
-    return false;
-  }
-
-  Document doc;
-  doc.Parse(jsonString.c_str());
-  if (doc.GetParseError() || !doc["active"].GetBool())
-  {
-    kodi::Log(ADDON_LOG_ERROR, "Initialize session failed.");
-    m_nextLoginAttempt = std::time(0) + 300;
-    return false;
-  }
-  
-  if (doc["account"].IsNull())
-  {
-     kodi::Log(ADDON_LOG_DEBUG, "Need to login.");
-     m_httpClient->ClearSession();
-     
-     kodi::Log(ADDON_LOG_DEBUG, "Try to login.");
-
-     std::ostringstream dataStream;
-     dataStream << "login=" << Utils::UrlEncode(m_settings->GetZatUsername()) << "&password="
-         << Utils::UrlEncode(m_settings->GetZatPassword()) << "&format=json&remember=true";
-     int statusCode;
-     std::string jsonString = m_httpClient->HttpPost(m_providerUrl + "/zapi/v3/account/login", dataStream.str(), statusCode);
-     doc.Parse(jsonString.c_str());     
-     
-     if (doc.GetParseError() || !doc["active"].GetBool())
-     {
-       kodi::Log(ADDON_LOG_ERROR, "Login failed.");
-           m_nextLoginAttempt = std::time(0) + 300;
-       Reset();
-       return false;
-     }
-     else
-     {
-       kodi::Log(ADDON_LOG_DEBUG, "Login was successful.");
-     }
-  }
-  
-  const Value& account = doc["account"];
-  const Value& nonlive = doc["nonlive"];
-  
-  m_countryCode = Utils::JsonStringOrEmpty(doc, "current_country");
-  m_serviceRegionCountry = Utils::JsonStringOrEmpty(account, "service_country");
-  m_recallEnabled = Utils::JsonStringOrEmpty(nonlive, "replay_availability") == "available";
-  m_recordingEnabled = Utils::JsonBoolOrFalse(nonlive, "recording_number_limit");
-  kodi::Log(ADDON_LOG_INFO, "Current country code: %s", m_countryCode.c_str());
-  kodi::Log(ADDON_LOG_INFO, "Service region country: %s",
-      m_serviceRegionCountry.c_str());
-  kodi::Log(ADDON_LOG_INFO, "Recall are %s",
-      m_recallEnabled ? "enabled" : "disabled");
-  kodi::Log(ADDON_LOG_INFO, "Recordings are %s",
-      m_recordingEnabled ? "enabled" : "disabled");
-  m_powerHash = Utils::JsonStringOrEmpty(doc, "power_guide_hash");
-  
-  
-  return true;
-}
-
-bool Session::LoadAppId()
-{
-  if (!m_appToken.empty()) {
-    return true;
-  }
-  
-  if (!LoadAppTokenFromTokenJson("token.json")) {
-    int statusCode;
-    std::string html = m_httpClient->HttpGet(m_providerUrl + "/login", statusCode);
-  
-    if (!LoadAppTokenFromHtml(html)) {
-      if (!LoadAppTokenFromJson(html)) {
-        m_appToken = m_parameterDB->Get("appToken");
-        return !m_appToken.empty();
-      }
-    }
-  }
-  m_parameterDB->Set("appToken", m_appToken);
-  return true;
-}
-
-bool Session::LoadAppTokenFromTokenJson(std::string tokenJsonPath) {
-  int statusCode;
-  std::string jsonString = m_httpClient->HttpGet(m_providerUrl + "/" + tokenJsonPath, statusCode);
-
-  Document doc;
-  doc.Parse(jsonString.c_str());
-  if (doc.GetParseError() || !doc["success"].GetBool())
-  {
-    kodi::Log(ADDON_LOG_DEBUG, "Failed to load json from %s", tokenJsonPath.c_str());
-    return false;
-  }
-
-  m_appToken = doc["session_token"].GetString();
-  return true;
-}
-
-bool Session::LoadAppTokenFromHtml(std::string html) {
-  size_t basePos = html.find("window.appToken = '") + 19;
-  if (basePos > 19)
-  {
-    size_t endPos = html.find("'", basePos);
-    m_appToken = html.substr(basePos, endPos - basePos);
-    return true;
-  }
-  return false;
-}
-
-bool Session::LoadAppTokenFromJson(std::string html) {
-  size_t basePos = html.find("src=\"/app-") + 5;
-  if (basePos < 6) {
-    kodi::Log(ADDON_LOG_ERROR, "Unable to find app-*.js");
-    return false;
-  }
-  size_t endPos = html.find("\"", basePos);
-  std::string appJsPath = html.substr(basePos, endPos - basePos);
-  int statusCode;
-  std::string content = m_httpClient->HttpGet(m_providerUrl + appJsPath, statusCode);
-
-  basePos = content.find("\"token-") + 1;
-  if (basePos < 6) {
-    kodi::Log(ADDON_LOG_ERROR, "Unable to find token-*.json in %s", appJsPath.c_str());
-    return false;
-  }
-  endPos = content.find("\"", basePos);
-  std::string tokenJsonPath = content.substr(basePos, endPos - basePos);
-  return LoadAppTokenFromTokenJson(tokenJsonPath);
-}
-
-bool Session::SendHello()
-{
-  std::string uuid = m_httpClient->GetUUID();
-  kodi::Log(ADDON_LOG_DEBUG, "Send hello.");
-  std::ostringstream dataStream;
-  dataStream << "uuid=" << uuid << "&lang=en&app_version=3.2038.0&format=json&client_app_token="
-      << m_appToken;
-  int statusCode;
-  std::string jsonString = m_httpClient->HttpPost(m_providerUrl + "/zapi/v3/session/hello", dataStream.str(), statusCode);
-
-  Document doc;
-  doc.Parse(jsonString.c_str());
-  if (!doc.GetParseError() && doc["active"].GetBool())
-  {
-    kodi::Log(ADDON_LOG_DEBUG, "Hello was successful.");
-    return true;
-  }
-  else
-  {
-    kodi::Log(ADDON_LOG_INFO, "Hello failed.");
-    return false;
-  }
-}
-
-void Session::Reset()
-{
-  SetProviderUrl();
-  m_isConnected = false;
-  m_httpClient->ClearSession();
-  m_appToken = "";
-  m_parameterDB->Set("appToken", m_appToken);
-  m_zatData->UpdateConnectionState("Zattoo session expired", PVR_CONNECTION_STATE_CONNECTING, "");
-}
-
-void Session::ErrorStatusCode (int statusCode) {
-  if (statusCode == 403)
-  {
-    kodi::Log(ADDON_LOG_ERROR, "Got 403. Try to re-init session.");
-    Reset();
-  }
-}
-
-void Session::SetProviderUrl() {
-  switch (m_settings->GetProvider())
-    {
-    case 1:
-      m_providerUrl = "https://www.netplus.tv";
-      break;
-    case 2:
-      m_providerUrl = "https://mobiltv.quickline.com";
-      break;
-    case 3:
-      m_providerUrl = "https://tvplus.m-net.de";
-      break;
-    case 4:
-      m_providerUrl = "https://player.waly.tv";
-      break;
-    case 5:
-      m_providerUrl = "https://www.meinewelt.cc";
-      break;
-    case 6:
-      m_providerUrl = "https://www.bbv-tv.net";
-      break;
-    case 7:
-      m_providerUrl = "https://www.vtxtv.ch";
-      break;
-    case 8:
-      m_providerUrl = "https://www.myvisiontv.ch";
-      break;
-    case 9:
-      m_providerUrl = "https://iptv.glattvision.ch";
-      break;
-    case 10:
-      m_providerUrl = "https://www.saktv.ch";
-      break;
-    case 11:
-      m_providerUrl = "https://nettv.netcologne.de";
-      break;
-    case 12:
-      m_providerUrl = "https://tvonline.ewe.de";
-      break;
-    case 13:
-      m_providerUrl = "https://www.quantum-tv.com";
-      break;
-    case 14:
-      m_providerUrl = "https://tv.salt.ch";
-      break;
-    case 15:
-      m_providerUrl = "https://tvonline.swb-gruppe.de";
-      break;
-    case 16:
-      m_providerUrl = "https://www.1und1.tv";
-      break;
-    default:
-      m_providerUrl = "https://zattoo.com";
-    }
-}
diff -pruN 19.7.13+ds1-1/src/Session.h 20.2.1+ds1-1/src/Session.h
--- 19.7.13+ds1-1/src/Session.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/Session.h	1970-01-01 00:00:00.000000000 +0000
@@ -1,75 +0,0 @@
-#ifndef SRC_SESSION_H_
-#define SRC_SESSION_H_
-
-#include "http/HttpClient.h"
-#include "http/HttpStatusCodeHandler.h"
-#include "Utils.h"
-#include "Settings.h"
-
-#include <thread>
-
-class ZatData;
-
-class Session: public HttpStatusCodeHandler
-{
-public:
-  Session(HttpClient* httpClient, ZatData* zatData, CSettings* settings, ParameterDB *parameterDB);
-  ~Session();
-  ADDON_STATUS Start();
-  void Stop();
-  void LoginThread();
-  void Reset();
-  void ErrorStatusCode (int statusCode);
-  bool IsConnected() {
-    return m_isConnected;
-  }
-  std::string GetAppToken() {
-    return m_appToken;
-  }
-  std::string GetPowerHash() {
-    return m_powerHash;
-  }
-  std::string GetCountryCode() {
-    return m_countryCode;
-  }
-  std::string GetServiceRegionCountry() {
-    return m_serviceRegionCountry;
-  }
-  bool IsRecallEnabled() {
-    return m_recallEnabled;
-  }
-  bool IsRecordingEnabled() {
-    return m_recordingEnabled;
-  }
-  std::string GetProviderUrl() {
-    return m_providerUrl;
-  }
-private:
-  bool Login(std::string u, std::string p);
-  bool LoadAppId();
-  bool LoadAppTokenFromTokenJson(std::string tokenJsonPath);
-  bool LoadAppTokenFromFile();
-  bool LoadAppTokenFromJson(std::string html);
-  bool LoadAppTokenFromHtml(std::string html);
-  bool SendHello();
-  void SetProviderUrl();
-  HttpClient* m_httpClient;
-  ZatData* m_zatData;
-  CSettings* m_settings;
-  ParameterDB *m_parameterDB;
-  time_t m_nextLoginAttempt = 0;
-  bool m_isConnected = false;
-  bool m_running = false;
-  std::thread m_thread;
-  std::string m_appToken;
-  std::string m_powerHash;
-  std::string m_countryCode;
-  std::string m_serviceRegionCountry;
-  bool m_recallEnabled = false;
-  bool m_recordingEnabled = false;
-  std::string m_providerUrl;
-};
-
-
-
-#endif /* SRC_SESSION_H_ */
diff -pruN 19.7.13+ds1-1/src/Settings.cpp 20.2.1+ds1-1/src/Settings.cpp
--- 19.7.13+ds1-1/src/Settings.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/Settings.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -6,33 +6,32 @@
  */
 
 #include "Settings.h"
-#include <kodi/General.h>
 
 bool CSettings::Load()
 {
-  if (!kodi::CheckSettingString("username", m_zatUsername))
+  if (!kodi::addon::CheckSettingString("username", m_zatUsername))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR, "Couldn't get 'username' setting");
     return false;
   }
 
-  if (!kodi::CheckSettingString("password", m_zatPassword))
+  if (!kodi::addon::CheckSettingString("password", m_zatPassword))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR, "Couldn't get 'password' setting");
     return false;
   }
 
-  if (!kodi::CheckSettingBoolean("favoritesonly", m_zatFavoritesOnly))
+  if (!kodi::addon::CheckSettingBoolean("favoritesonly", m_zatFavoritesOnly))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR,
-              "Couldn't get 'favoritesonly' setting, falling back to 'false' as default");
+              "Couldn't get 'useradio' setting, falling back to 'false' as default");
     m_zatFavoritesOnly = false;
   }
-  
-  if (!kodi::CheckSettingBoolean("enableDolby", m_zatEnableDolby))
+
+  if (!kodi::addon::CheckSettingBoolean("enableDolby", m_zatEnableDolby))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR,
@@ -40,21 +39,21 @@ bool CSettings::Load()
     m_zatEnableDolby = true;
   }
 
-  if (!kodi::CheckSettingEnum<STREAM_TYPE>("streamtype", m_streamType))
+  if (!kodi::addon::CheckSettingEnum<STREAM_TYPE>("streamtype", m_streamType))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR, "Couldn't get 'streamtype' setting, falling back to 'DASH' as default");
     m_streamType = DASH;
   }
 
-  if (!kodi::CheckSettingString("parentalPin", m_parentalPin))
+  if (!kodi::addon::CheckSettingString("parentalPin", m_parentalPin))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR, "Couldn't get 'parentalPin' setting, falling back to 'empty' as default");
     m_parentalPin = "";
   }
 
-  if (!kodi::CheckSettingInt("provider", m_provider))
+  if (!kodi::addon::CheckSettingInt("provider", m_provider))
   {
     /* If setting is unknown fallback to defaults */
     kodi::Log(ADDON_LOG_ERROR,
@@ -66,7 +65,7 @@ bool CSettings::Load()
 }
 
 ADDON_STATUS CSettings::SetSetting(const std::string& settingName,
-                                   const kodi::CSettingValue& settingValue)
+                                   const kodi::addon::CSettingValue& settingValue)
 {
   if (settingName == "username")
   {
@@ -134,15 +133,3 @@ ADDON_STATUS CSettings::SetSetting(const
 
   return ADDON_STATUS_OK;
 }
-
-bool CSettings::VerifySettings() {
-  std::string username = GetZatUsername();
-  std::string password = GetZatPassword();
-  if (username.empty() || password.empty()) {
-    kodi::Log(ADDON_LOG_INFO, "Username or password not set.");
-    kodi::QueueNotification(QUEUE_WARNING, "", kodi::GetLocalizedString(30200));
-
-    return false;
-  }
-  return true;
-}
diff -pruN 19.7.13+ds1-1/src/Settings.h 20.2.1+ds1-1/src/Settings.h
--- 19.7.13+ds1-1/src/Settings.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/Settings.h	2022-01-02 17:18:23.000000000 +0000
@@ -16,14 +16,13 @@ enum STREAM_TYPE : int
   DASH_WIDEVINE
 };
 
-class ATTRIBUTE_HIDDEN CSettings
+class ATTR_DLL_LOCAL CSettings
 {
 public:
   CSettings() = default;
 
   bool Load();
-  ADDON_STATUS SetSetting(const std::string& settingName, const kodi::CSettingValue& settingValue);
-  bool VerifySettings();
+  ADDON_STATUS SetSetting(const std::string& settingName, const kodi::addon::CSettingValue& settingValue);
 
   const std::string& GetZatUsername() const { return m_zatUsername; }
   const std::string& GetZatPassword() const { return m_zatPassword; }
diff -pruN 19.7.13+ds1-1/src/sql/EpgDB.cpp 20.2.1+ds1-1/src/sql/EpgDB.cpp
--- 19.7.13+ds1-1/src/sql/EpgDB.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/sql/EpgDB.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,4 +1,3 @@
-#include <kodi/AddonBase.h>
 #include "EpgDB.h"
 
 const int DB_VERSION = 3;
@@ -76,9 +75,6 @@ EpgDB::~EpgDB() {
 bool EpgDB::MigrateDbIfRequired() {
   int currentVersion = GetVersion();
   while (currentVersion < DB_VERSION) {
-    if (currentVersion < 0) {
-      return false;
-    }
     switch (currentVersion) {
     case 0:
       if (!Migrate0To1()) {
diff -pruN 19.7.13+ds1-1/src/sql/ParameterDB.cpp 20.2.1+ds1-1/src/sql/ParameterDB.cpp
--- 19.7.13+ds1-1/src/sql/ParameterDB.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/sql/ParameterDB.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,4 +1,3 @@
-#include <kodi/AddonBase.h>
 #include "ParameterDB.h"
 
 const int DB_VERSION = 1;
@@ -34,9 +33,6 @@ ParameterDB::~ParameterDB() {
 bool ParameterDB::MigrateDbIfRequired() {
   int currentVersion = GetVersion();
   while (currentVersion < DB_VERSION) {
-    if (currentVersion < 0) {
-      return false;
-    }
     switch (currentVersion) {
     case 0:
       if (!Migrate0To1()) {
diff -pruN 19.7.13+ds1-1/src/sql/RecordingsDB.cpp 20.2.1+ds1-1/src/sql/RecordingsDB.cpp
--- 19.7.13+ds1-1/src/sql/RecordingsDB.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/sql/RecordingsDB.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,4 +1,3 @@
-#include <kodi/AddonBase.h>
 #include "RecordingsDB.h"
 
 const int DB_VERSION = 1;
@@ -37,9 +36,6 @@ RecordingsDB::~RecordingsDB() {
 bool RecordingsDB::MigrateDbIfRequired() {
   int currentVersion = GetVersion();
   while (currentVersion < DB_VERSION) {
-    if (currentVersion < 0) {
-      return false;
-    }
     switch (currentVersion) {
     case 0:
       if (!Migrate0To1()) {
diff -pruN 19.7.13+ds1-1/src/sql/SQLConnection.cpp 20.2.1+ds1-1/src/sql/SQLConnection.cpp
--- 19.7.13+ds1-1/src/sql/SQLConnection.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/sql/SQLConnection.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,4 +1,3 @@
-#include <kodi/AddonBase.h>
 #include "SQLConnection.h"
 
 class ProcessSingleIntRowCallback : public ProcessRowCallback {
diff -pruN 19.7.13+ds1-1/src/sql/SQLConnection.h 20.2.1+ds1-1/src/sql/SQLConnection.h
--- 19.7.13+ds1-1/src/sql/SQLConnection.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/sql/SQLConnection.h	2022-01-02 17:18:23.000000000 +0000
@@ -2,6 +2,7 @@
 
 #include <string>
 #include "sqlite/sqlite3.h"
+#include "../client.h"
 
 class ProcessRowCallback {
 public:
diff -pruN 19.7.13+ds1-1/src/UpdateThread.cpp 20.2.1+ds1-1/src/UpdateThread.cpp
--- 19.7.13+ds1-1/src/UpdateThread.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/UpdateThread.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,6 +1,6 @@
 #include "UpdateThread.h"
 #include <ctime>
-#include <kodi/AddonBase.h>
+#include "client.h"
 #include "ZatData.h"
 #include "http/Cache.h"
 
diff -pruN 19.7.13+ds1-1/src/Utils.cpp 20.2.1+ds1-1/src/Utils.cpp
--- 19.7.13+ds1-1/src/Utils.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/Utils.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -14,7 +14,7 @@
 
 std::string Utils::GetFilePath(const std::string &strPath, bool bUserPath)
 {
-  return bUserPath ? kodi::GetBaseUserPath(strPath) : kodi::GetAddonPath(strPath);
+  return bUserPath ? kodi::addon::GetUserPath(strPath) : kodi::addon::GetAddonPath(strPath);
 }
 
 // http://stackoverflow.com/a/17708801
diff -pruN 19.7.13+ds1-1/src/ZatData.cpp 20.2.1+ds1-1/src/ZatData.cpp
--- 19.7.13+ds1-1/src/ZatData.cpp	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/ZatData.cpp	2022-01-02 17:18:23.000000000 +0000
@@ -1,3 +1,5 @@
+#include "client.h"
+
 #include <iostream>
 #include <string>
 #include "ZatData.h"
@@ -23,7 +25,7 @@ const char data_file[] = "special://prof
 
 std::string ZatData::GetManifestType()
 {
-  switch (m_settings->GetStreamType())
+  switch (m_streamType)
   {
     case HLS:
       return "hls";
@@ -34,7 +36,7 @@ std::string ZatData::GetManifestType()
 
 std::string ZatData::GetMimeType()
 {
-  switch (m_settings->GetStreamType())
+  switch (m_streamType)
   {
     case HLS:
       return "application/x-mpegURL";
@@ -52,7 +54,7 @@ void ZatData::SetStreamProperties(
   properties.emplace_back("inputstream.adaptive.manifest_type", GetManifestType());
   properties.emplace_back(PVR_STREAM_PROPERTY_MIMETYPE, GetMimeType());
 
-  if (m_settings->GetStreamType() == DASH || m_settings->GetStreamType() == DASH_WIDEVINE)
+  if (m_streamType == DASH || m_streamType == DASH_WIDEVINE)
   {
     properties.emplace_back("inputstream.adaptive.manifest_update_parameter", "full");
   }
@@ -97,10 +99,183 @@ bool ZatData::ReadDataJson()
   return true;
 }
 
+bool ZatData::LoadAppId()
+{
+  if (!m_appToken.empty()) {
+    return true;
+  }
+  
+  if (!LoadAppTokenFromTokenJson("token.json")) {
+    int statusCode;
+    std::string html = m_httpClient->HttpGet(m_providerUrl + "/login", statusCode);
+  
+    if (!LoadAppTokenFromHtml(html)) {
+      if (!LoadAppTokenFromJson(html)) {
+        m_appToken = m_parameterDB->Get("appToken");
+        return !m_appToken.empty();
+      }
+    }
+  }
+  m_parameterDB->Set("appToken", m_appToken);
+  return true;
+}
+
+bool ZatData::LoadAppTokenFromTokenJson(std::string tokenJsonPath) {
+  int statusCode;
+  std::string jsonString = m_httpClient->HttpGet(m_providerUrl + "/" + tokenJsonPath, statusCode);
+
+  Document doc;
+  doc.Parse(jsonString.c_str());
+  if (doc.GetParseError() || !doc["success"].GetBool())
+  {
+    kodi::Log(ADDON_LOG_DEBUG, "Failed to load json from %s", tokenJsonPath.c_str());
+    return false;
+  }
+
+  m_appToken = doc["session_token"].GetString();
+  return true;
+}
+
+bool ZatData::LoadAppTokenFromHtml(std::string html) {
+  size_t basePos = html.find("window.appToken = '") + 19;
+  if (basePos > 19)
+  {
+    size_t endPos = html.find("'", basePos);
+    m_appToken = html.substr(basePos, endPos - basePos);
+    return true;
+  }
+  return false;
+}
+
+bool ZatData::LoadAppTokenFromJson(std::string html) {
+  size_t basePos = html.find("src=\"/app-") + 5;
+  if (basePos < 6) {
+    kodi::Log(ADDON_LOG_ERROR, "Unable to find app-*.js");
+    return false;
+  }
+  size_t endPos = html.find("\"", basePos);
+  std::string appJsPath = html.substr(basePos, endPos - basePos);
+  int statusCode;
+  std::string content = m_httpClient->HttpGet(m_providerUrl + appJsPath, statusCode);
+
+  basePos = content.find("\"token-") + 1;
+  if (basePos < 6) {
+    kodi::Log(ADDON_LOG_ERROR, "Unable to find token-*.json in %s", appJsPath.c_str());
+    return false;
+  }
+  endPos = content.find("\"", basePos);
+  std::string tokenJsonPath = content.substr(basePos, endPos - basePos);
+  return LoadAppTokenFromTokenJson(tokenJsonPath);
+}
+
+bool ZatData::SendHello()
+{
+  std::string uuid = m_httpClient->GetUUID();
+  kodi::Log(ADDON_LOG_DEBUG, "Send hello.");
+  std::ostringstream dataStream;
+  dataStream << "uuid=" << uuid << "&lang=en&app_version=3.2038.0&format=json&client_app_token="
+      << m_appToken;
+  int statusCode;
+  std::string jsonString = m_httpClient->HttpPost(m_providerUrl + "/zapi/v3/session/hello", dataStream.str(), statusCode);
+
+  Document doc;
+  doc.Parse(jsonString.c_str());
+  if (!doc.GetParseError() && doc["active"].GetBool())
+  {
+    kodi::Log(ADDON_LOG_DEBUG, "Hello was successful.");
+    return true;
+  }
+  else
+  {
+    kodi::Log(ADDON_LOG_INFO, "Hello failed.");
+    return false;
+  }
+}
+
+Document ZatData::Login()
+{
+  kodi::Log(ADDON_LOG_DEBUG, "Try to login.");
+
+  std::ostringstream dataStream;
+  dataStream << "login=" << Utils::UrlEncode(m_username) << "&password="
+      << Utils::UrlEncode(m_password) << "&format=json&remember=true";
+  int statusCode;
+  std::string jsonString = m_httpClient->HttpPost(m_providerUrl + "/zapi/v3/account/login", dataStream.str(), statusCode);
+  Document doc;
+  doc.Parse(jsonString.c_str());
+  return doc;
+}
+
+bool ZatData::ReinitSession()
+{
+  m_httpClient->ClearSession();
+  m_appToken = "";
+  
+  return InitSession(true);
+}
+
+bool ZatData::InitSession(bool isReinit)
+{
+  if (!LoadAppId())
+  {
+    return isReinit ? false : ReinitSession();
+  }
+  
+  SendHello();
+  int statusCode;
+  std::string jsonString = m_httpClient->HttpGet(m_providerUrl + "/zapi/v3/session", statusCode);
+  Document doc;
+  doc.Parse(jsonString.c_str());
+  if (doc.GetParseError() || !doc["active"].GetBool())
+  {
+    kodi::Log(ADDON_LOG_ERROR, "Initialize session failed.");
+    return isReinit ? false : ReinitSession();
+  }
+  
+  if (doc["account"].IsNull())
+  {
+    kodi::Log(ADDON_LOG_DEBUG, "Need to login.");
+    m_httpClient->ClearSession();
+    doc = Login();
+    if (doc.GetParseError() || !doc["active"].GetBool())
+    {
+      kodi::Log(ADDON_LOG_ERROR, "Login failed.");
+      return isReinit ? false : ReinitSession();
+    }
+    else
+    {
+      kodi::Log(ADDON_LOG_DEBUG, "Login was successful.");
+    }
+  }
+
+  const Value& account = doc["account"];
+  const Value& nonlive = doc["nonlive"];
+
+  m_countryCode = Utils::JsonStringOrEmpty(doc, "current_country");
+  m_serviceRegionCountry = Utils::JsonStringOrEmpty(account, "service_country");
+  m_recallEnabled = Utils::JsonStringOrEmpty(nonlive, "replay_availability") == "available";
+  m_recordingEnabled = Utils::JsonBoolOrFalse(nonlive, "recording_number_limit");
+  kodi::Log(ADDON_LOG_INFO, "Current country code: %s", m_countryCode.c_str());
+  kodi::Log(ADDON_LOG_INFO, "Service region country: %s",
+      m_serviceRegionCountry.c_str());
+  kodi::Log(ADDON_LOG_INFO, "Stream type: %s", GetStreamTypeString().c_str());
+  kodi::Log(ADDON_LOG_INFO, "Recall are %s",
+      m_recallEnabled ? "enabled" : "disabled");
+  kodi::Log(ADDON_LOG_INFO, "Recordings are %s",
+      m_recordingEnabled ? "enabled" : "disabled");
+  m_powerHash = Utils::JsonStringOrEmpty(doc, "power_guide_hash");
+  
+  if (m_epgProvider) {
+    delete m_epgProvider;
+  }
+  m_epgProvider = new ZattooEpgProvider(this, m_providerUrl, *m_epgDB, *m_httpClient, m_categories, m_visibleChannelsByCid, m_powerHash);
+  return true;
+}
+
 bool ZatData::LoadChannels()
 {
   std::map<std::string, ZatChannel> allChannels;
-  std::string jsonString = HttpGetWithRetry(m_session->GetProviderUrl() + "/zapi/channels/favorites");
+  std::string jsonString = HttpGetWithRetry(m_providerUrl + "/zapi/channels/favorites");
   Document favDoc;
   favDoc.Parse(jsonString.c_str());
 
@@ -111,7 +286,7 @@ bool ZatData::LoadChannels()
   const Value& favs = favDoc["favorites"];
 
   std::ostringstream urlStream;
-  urlStream << m_session->GetProviderUrl() + "/zapi/v3/cached/"  << m_session->GetPowerHash() << "/channels";
+  urlStream << m_providerUrl + "/zapi/v3/cached/"  << m_powerHash << "/channels";
   jsonString = HttpGetWithRetry(urlStream.str());
 
   Document doc;
@@ -186,7 +361,7 @@ bool ZatData::LoadChannels()
     }
   }
   
-  if (m_settings->GetZatFavoritesOnly()) {
+  if (m_favoritesOnly) {
     m_channelGroups.clear();
   }
 
@@ -204,7 +379,7 @@ bool ZatData::LoadChannels()
 PVR_ERROR ZatData::GetChannelGroupsAmount(int& amount)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
@@ -213,24 +388,79 @@ PVR_ERROR ZatData::GetChannelGroupsAmoun
   return PVR_ERROR_NO_ERROR;
 }
 
-ZatData::ZatData() :
-  m_settings(new CSettings())
+ZatData::ZatData(const kodi::addon::IInstanceInfo& instance,
+      const std::string& u, const std::string& p, bool favoritesOnly,
+      const STREAM_TYPE& streamType, bool enableDolby, int provider,
+      const std::string& parentalPin) :
+    kodi::addon::CInstancePVRClient(instance),
+    m_favoritesOnly(favoritesOnly),
+    m_enableDolby(enableDolby),
+    m_streamType(streamType),
+    m_username(u),
+    m_password(p),
+    m_parentalPin(parentalPin)
 {
-  UpdateConnectionState("Initializing", PVR_CONNECTION_STATE_CONNECTING, "");
-  m_settings->Load();
+  
   m_epgDB = new EpgDB(UserPath());
   m_recordingsDB = new RecordingsDB(UserPath());
   m_parameterDB = new ParameterDB(UserPath());
   m_httpClient = new HttpClient(m_parameterDB);
-  m_session = new Session(m_httpClient, this, m_settings, m_parameterDB);
-  m_httpClient->SetStatusCodeHandler(m_session);
   
-  ReadDataJson();
-  
-  for (int i = 0; i < 3; ++i)
+  switch (provider)
   {
-    m_updateThreads.emplace_back(new UpdateThread(*this, i, this));
+  case 1:
+    m_providerUrl = "https://www.netplus.tv";
+    break;
+  case 2:
+    m_providerUrl = "https://mobiltv.quickline.com";
+    break;
+  case 3:
+    m_providerUrl = "https://tvplus.m-net.de";
+    break;
+  case 4:
+    m_providerUrl = "https://player.waly.tv";
+    break;
+  case 5:
+    m_providerUrl = "https://www.meinewelt.cc";
+    break;
+  case 6:
+    m_providerUrl = "https://www.bbv-tv.net";
+    break;
+  case 7:
+    m_providerUrl = "https://www.vtxtv.ch";
+    break;
+  case 8:
+    m_providerUrl = "https://www.myvisiontv.ch";
+    break;
+  case 9:
+    m_providerUrl = "https://iptv.glattvision.ch";
+    break;
+  case 10:
+    m_providerUrl = "https://www.saktv.ch";
+    break;
+  case 11:
+    m_providerUrl = "https://nettv.netcologne.de";
+    break;
+  case 12:
+    m_providerUrl = "https://tvonline.ewe.de";
+    break;
+  case 13:
+    m_providerUrl = "https://www.quantum-tv.com";
+    break;
+  case 14:
+    m_providerUrl = "https://tv.salt.ch";
+    break;
+  case 15:
+    m_providerUrl = "https://tvonline.swb-gruppe.de";
+    break;
+  case 16:
+    m_providerUrl = "https://www.1und1.tv";
+    break;
+  default:
+    m_providerUrl = "https://zattoo.com";
   }
+  
+  ReadDataJson();
 }
 
 ZatData::~ZatData()
@@ -244,13 +474,27 @@ ZatData::~ZatData()
   if (m_epgProvider) {
     delete m_epgProvider;
   }
-  delete m_session;
   delete m_httpClient;
   delete m_parameterDB;
   delete m_recordingsDB;
   delete m_epgDB;
 }
 
+bool ZatData::Initialize()
+{
+  if (!InitSession(false)) {
+    m_initDone = false;
+    return false;
+  }
+
+  for (int i = 0; i < 3; ++i)
+  {
+    m_updateThreads.emplace_back(new UpdateThread(*this, i, this));
+  }
+  m_initDone = true;
+  return true;
+}
+
 PVR_ERROR ZatData::GetCapabilities(kodi::addon::PVRCapabilities& capabilities)
 {
   capabilities.SetSupportsEPG(true);
@@ -264,8 +508,9 @@ PVR_ERROR ZatData::GetCapabilities(kodi:
   capabilities.SetSupportsRecordingsLifetimeChange(false);
   capabilities.SetSupportsDescrambleInfo(false);
   capabilities.SetSupportsRecordingEdl(true);
-  capabilities.SetSupportsRecordings(m_session->IsRecordingEnabled());
-  capabilities.SetSupportsTimers(m_session->IsRecordingEnabled());
+  capabilities.SetSupportsRecordings(m_recordingEnabled);
+  capabilities.SetSupportsRecordingsDelete(m_recordingEnabled);
+  capabilities.SetSupportsTimers(m_recordingEnabled);
 
   return PVR_ERROR_NO_ERROR;
 }
@@ -290,7 +535,7 @@ PVR_ERROR ZatData::GetBackendHostname(st
 
 PVR_ERROR ZatData::GetConnectionString(std::string& connection)
 {
-  connection = m_session->IsConnected() ? "connected" : "not connected";
+  connection = "connected";
   return PVR_ERROR_NO_ERROR;
 }
 
@@ -299,7 +544,7 @@ PVR_ERROR ZatData::GetChannelGroups(bool
   if (radio)
     return PVR_ERROR_NOT_IMPLEMENTED;
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
@@ -333,7 +578,7 @@ PVR_ERROR ZatData::GetChannelGroupMember
                                           kodi::addon::PVRChannelGroupMembersResultSet& results)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
@@ -359,7 +604,7 @@ PVR_ERROR ZatData::GetChannelGroupMember
 
 PVR_ERROR ZatData::GetChannelsAmount(int& amount)
 {
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
@@ -373,7 +618,7 @@ PVR_ERROR ZatData::GetChannels(bool radi
   if (radio)
     return PVR_ERROR_NO_ERROR;
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
@@ -439,7 +684,7 @@ std::string ZatData::GetStreamUrl(std::s
     const Value& watchUrl = (*itr);
     kodi::Log(ADDON_LOG_DEBUG, "Selected url for maxrate: %d", watchUrl["maxrate"].GetInt());
     url = Utils::JsonStringOrEmpty(watchUrl, "url");
-    if (m_settings->GetStreamType() == DASH_WIDEVINE) {
+    if (m_streamType == DASH_WIDEVINE) {
       std::string licenseUrl = Utils::JsonStringOrEmpty(watchUrl, "license_url");
       properties.emplace_back("inputstream.adaptive.license_key", licenseUrl + "||A{SSM}|");
       properties.emplace_back("inputstream.adaptive.license_type", "com.widevine.alpha");
@@ -461,7 +706,7 @@ PVR_ERROR ZatData::GetChannelStreamPrope
   std::ostringstream dataStream;
   dataStream << GetStreamParameters() << "&format=json&timeshift=10800";
 
-  std::string jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + "/zapi/watch/live/" + ownChannel->cid, dataStream.str());
+  std::string jsonString = HttpPostWithRetry(m_providerUrl + "/zapi/watch/live/" + ownChannel->cid, dataStream.str());
 
   std::string strUrl = GetStreamUrl(jsonString, properties);
   if (!strUrl.empty())
@@ -545,8 +790,8 @@ bool ZatData::ParseRecordingsTimers(cons
   {
     int bucketSize = 100;
     std::ostringstream urlStream;
-    urlStream << m_session->GetProviderUrl() << "/zapi/v2/cached/program/power_details/"
-        << m_session->GetPowerHash() << "?complete=True&program_ids=";
+    urlStream << m_providerUrl << "/zapi/v2/cached/program/power_details/"
+        << m_powerHash << "?complete=True&program_ids=";
     while (bucketSize > 0 && recordingsItr != recordings.End())
     {
       const Value& recording = (*recordingsItr);
@@ -604,12 +849,12 @@ PVR_ERROR ZatData::GetTimerTypes(std::ve
 PVR_ERROR ZatData::GetTimers(kodi::addon::PVRTimersResultSet& results)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
   
-  std::string jsonString = HttpGetWithRetry(m_session->GetProviderUrl() + "/zapi/v2/playlist");
+  std::string jsonString = HttpGetWithRetry(m_providerUrl + "/zapi/v2/playlist");
 
   Document doc;
   doc.Parse(jsonString.c_str());
@@ -714,12 +959,12 @@ PVR_ERROR ZatData::GetTimers(kodi::addon
 PVR_ERROR ZatData::GetTimersAmount(int& amount)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
   
-  std::string jsonString = HttpGetCachedWithRetry(m_session->GetProviderUrl() + "/zapi/v2/playlist", 60);
+  std::string jsonString = HttpGetCachedWithRetry(m_providerUrl + "/zapi/v2/playlist", 60);
 
   time_t current_time;
   time(&current_time);
@@ -774,7 +1019,7 @@ PVR_ERROR ZatData::DeleteTimer(const kod
   int recordingId = -1;
   
   if (series) {  
-    std::string jsonString = HttpGetWithRetry(m_session->GetProviderUrl() + "/zapi/v2/playlist");
+    std::string jsonString = HttpGetWithRetry(m_providerUrl + "/zapi/v2/playlist");
 
     Document doc;
     doc.Parse(jsonString.c_str());
@@ -810,7 +1055,7 @@ PVR_ERROR ZatData::DeleteTimer(const kod
 
   std::string path = series ? "/zapi/series_recording/remove" : "/zapi/playlist/remove";
 
-  std::string jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + path, dataStream.str());
+  std::string jsonString = HttpPostWithRetry(m_providerUrl + path, dataStream.str());
 
   Document doc;
   doc.Parse(jsonString.c_str());
@@ -829,12 +1074,12 @@ void ZatData::AddTimerType(std::vector<k
 PVR_ERROR ZatData::GetRecordings(bool deleted, kodi::addon::PVRRecordingsResultSet& results)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
   
-  std::string jsonString = HttpGetWithRetry(m_session->GetProviderUrl() + "/zapi/v2/playlist");
+  std::string jsonString = HttpGetWithRetry(m_providerUrl + "/zapi/v2/playlist");
 
   Document doc;
   doc.Parse(jsonString.c_str());
@@ -882,6 +1127,9 @@ PVR_ERROR ZatData::GetRecordings(bool de
     {
       kodi::addon::PVRRecording tag;
 
+      tag.SetSeriesNumber(PVR_RECORDING_INVALID_SERIES_EPISODE);
+      tag.SetEpisodeNumber(PVR_RECORDING_INVALID_SERIES_EPISODE);
+
       tag.SetIsDeleted(false);
 
       tag.SetRecordingId(std::to_string(recording["id"].GetInt()));
@@ -905,9 +1153,6 @@ PVR_ERROR ZatData::GetRecordings(bool de
         tag.SetGenreType(genre & 0xF0);
       }
 
-      if (Utils::JsonIntOrZero(recording, "tv_series_id")) {
-          tag.SetDirectory(tag.GetTitle());
-      }
       
       RecordingDBInfo recordingDBInfo = m_recordingsDB->Get(tag.GetRecordingId());
       tag.SetPlayCount(recordingDBInfo.playCount);
@@ -926,12 +1171,12 @@ PVR_ERROR ZatData::GetRecordings(bool de
 PVR_ERROR ZatData::GetRecordingsAmount(bool deleted, int& amount)
 {
   
-  if (!m_session->IsConnected())
+  if (!m_initDone)
   {
     return PVR_ERROR_SERVER_ERROR;
   }
   
-  std::string jsonString = HttpGetCachedWithRetry(m_session->GetProviderUrl() + "/zapi/v2/playlist", 60);
+  std::string jsonString = HttpGetCachedWithRetry(m_providerUrl + "/zapi/v2/playlist", 60);
 
   time_t current_time;
   time(&current_time);
@@ -961,18 +1206,18 @@ PVR_ERROR ZatData::GetRecordingsAmount(b
 }
 
 std::string ZatData::GetStreamParameters() {
-  std::string params = m_settings->GetZatEnableDolby() ? "&enable_eac3=true" : "";
+  std::string params = m_enableDolby ? "&enable_eac3=true" : "";
   params += "&stream_type=" + GetStreamTypeString();
 
-  if (!m_settings->GetParentalPin().empty()) {
-    params += "&youth_protection_pin=" + m_settings->GetParentalPin();
+  if (!m_parentalPin.empty()) {
+    params += "&youth_protection_pin=" + m_parentalPin;
   }
 
   return params;
 }
 
 std::string ZatData::GetStreamTypeString() {
-  switch (m_settings->GetStreamType()) {
+  switch (m_streamType) {
     case HLS:
       return "hls7";
     case DASH_WIDEVINE:
@@ -990,7 +1235,7 @@ PVR_ERROR ZatData::GetRecordingStreamPro
   std::ostringstream dataStream;
   dataStream << GetStreamParameters();
 
-  std::string jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + "/zapi/watch/recording/" + recording.GetRecordingId(), dataStream.str());
+  std::string jsonString = HttpPostWithRetry(m_providerUrl + "/zapi/watch/recording/" + recording.GetRecordingId(), dataStream.str());
 
   std::string strUrl = GetStreamUrl(jsonString, properties);
   PVR_ERROR ret = PVR_ERROR_FAILED;
@@ -1009,7 +1254,7 @@ bool ZatData::Record(int programId, bool
   
   dataStream << "program_id=" << programId << "&series_force=False&series=" << (series ? "True" : "False");
   
-  std::string jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + "/zapi/playlist/program", dataStream.str());
+  std::string jsonString = HttpPostWithRetry(m_providerUrl + "/zapi/playlist/program", dataStream.str());
   Document doc;
   doc.Parse(jsonString.c_str());
   return !doc.GetParseError() && doc["success"].GetBool();
@@ -1020,7 +1265,7 @@ PVR_ERROR ZatData::DeleteRecording(const
   std::ostringstream dataStream;
   dataStream << "recording_id=" << recording.GetRecordingId() << "";
 
-  std::string jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + "/zapi/playlist/remove", dataStream.str());
+  std::string jsonString = HttpPostWithRetry(m_providerUrl + "/zapi/playlist/remove", dataStream.str());
 
   Document doc;
   doc.Parse(jsonString.c_str());
@@ -1046,7 +1291,7 @@ PVR_ERROR ZatData::IsEPGTagPlayable(cons
 
 PVR_ERROR ZatData::IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable)
 {
-  if (!m_session->IsRecordingEnabled())
+  if (!m_recordingEnabled)
   {
     isRecordable = false;
   }
@@ -1071,7 +1316,7 @@ PVR_ERROR ZatData::GetEPGTagStreamProper
     kodi::Log(ADDON_LOG_WARNING, "Could not get url for channel %s and program %i. Try to get new EPG tag.", channel.cid.c_str(), tag.GetUniqueBroadcastId());
     time_t referenceTime = (tag.GetStartTime() / 2) + (tag.GetEndTime() / 2);
     std::ostringstream urlStream;
-    urlStream << m_session->GetProviderUrl() << "/zapi/v3/cached/" + m_session->GetPowerHash() + "/guide"
+    urlStream << m_providerUrl << "/zapi/v3/cached/" + m_powerHash + "/guide"
         << "?end=" << referenceTime << "&start=" << referenceTime
         << "&format=json";
 
@@ -1120,7 +1365,7 @@ std::string ZatData::GetStreamUrlForProg
 
   dataStream << GetStreamParameters();
   dataStream << "&pre_padding=0&post_padding=0";
-  jsonString = HttpPostWithRetry(m_session->GetProviderUrl() + "/zapi/v3/watch/replay/" + cid + "/" + std::to_string(programId), dataStream.str());
+  jsonString = HttpPostWithRetry(m_providerUrl + "/zapi/v3/watch/replay/" + cid + "/" + std::to_string(programId), dataStream.str());
 
   std::string strUrl = GetStreamUrl(jsonString, properties);
   return strUrl;
@@ -1136,77 +1381,41 @@ PVR_ERROR ZatData::GetEPGTagEdl(const ko
   return PVR_ERROR_NO_ERROR;
 }
 
-PVR_ERROR ZatData::GetRecordingEdl(const kodi::addon::PVRRecording& recording, std::vector<kodi::addon::PVREDLEntry>& edl)
-{
-  kodi::addon::PVREDLEntry entry;
-  entry.SetStart(0);
-  entry.SetEnd(300000);
-  entry.SetType(PVR_EDL_TYPE_COMBREAK);
-  edl.emplace_back(entry);
-  return PVR_ERROR_NO_ERROR;
+bool ZatData::TryToReinitIf403(int statusCode) {
+  if (statusCode == 403)
+  {
+    kodi::Log(ADDON_LOG_ERROR, "Got 403. Try to re-init session.");
+    if (InitSession(false)) {
+      return true;
+    }
+    kodi::Log(ADDON_LOG_ERROR, "Re-init of session. Failed.");
+  }
+  return false;
 }
 
 std::string ZatData::HttpGetWithRetry(std::string url) {
   int statusCode;
   std::string ret = m_httpClient->HttpGet(url, statusCode);
-  ret = m_httpClient->HttpGet(url, statusCode);
+  if (TryToReinitIf403(statusCode)) {
+    ret = m_httpClient->HttpGet(url, statusCode);
+  }
   return ret;
 }
 
 std::string ZatData::HttpPostWithRetry(std::string url, const std::string& postData) {
   int statusCode;
   std::string ret = m_httpClient->HttpPost(url, postData, statusCode);
-  ret = m_httpClient->HttpPost(url, postData, statusCode);
+  if (TryToReinitIf403(statusCode)) {
+    ret = m_httpClient->HttpPost(url, postData, statusCode);
+  }
   return ret;
 }
 
 std::string ZatData::HttpGetCachedWithRetry(std::string url, time_t cacheDuration) {
   int statusCode;
   std::string ret = m_httpClient->HttpGetCached(url, cacheDuration, statusCode);
-  ret = m_httpClient->HttpGetCached(url, cacheDuration, statusCode);
-  return ret;
-}
-
-void ZatData::UpdateConnectionState(const std::string& connectionString, PVR_CONNECTION_STATE newState, const std::string& message) {
-  kodi::addon::CInstancePVRClient::ConnectionStateChange(connectionString, newState, message);
-}
-
-ADDON_STATUS ZatData::GetStatus() {
-  if (!m_session->IsConnected()) {
-    return ADDON_STATUS_LOST_CONNECTION;
+  if (TryToReinitIf403(statusCode)) {
+    ret = m_httpClient->HttpGetCached(url, cacheDuration, statusCode);
   }
-  return ADDON_STATUS_OK;
-}
-
-bool ZatData::SessionInitialized()
-{
-  if (m_epgProvider) {
-    delete m_epgProvider;
-  }
-  kodi::Log(ADDON_LOG_INFO, "Stream type: %s", GetStreamTypeString().c_str());
-  if (!LoadChannels()) {
-    return false;
-  }
-  m_epgProvider = new ZattooEpgProvider(this, m_session->GetProviderUrl(), *m_epgDB, *m_httpClient, m_categories, m_visibleChannelsByCid, m_session->GetPowerHash());
-  return true;
-}
-
-ADDON_STATUS ZatData::SetSetting(const std::string& settingName, const kodi::CSettingValue& settingValue)
-{
-  ADDON_STATUS result = m_settings->SetSetting(settingName, settingValue);
-  if (!m_settings->VerifySettings()) {
-    return ADDON_STATUS_NEED_SETTINGS;
-  }
-  if (result == ADDON_STATUS_OK) {
-    m_session->Reset();
-  }
-  return result;
-}
-
-ADDON_STATUS ZatData::Create()
-{
-  kodi::Log(ADDON_LOG_DEBUG, "%s - Creating the PVR Zattoo add-on", __FUNCTION__);
-  return m_session->Start();
+  return ret;
 }
-
-ADDONCREATOR(ZatData);
diff -pruN 19.7.13+ds1-1/src/ZatData.h 20.2.1+ds1-1/src/ZatData.h
--- 19.7.13+ds1-1/src/ZatData.h	2022-04-17 13:47:53.000000000 +0000
+++ 20.2.1+ds1-1/src/ZatData.h	2022-01-02 17:18:23.000000000 +0000
@@ -5,13 +5,11 @@
 #include <mutex>
 #include "rapidjson/document.h"
 #include "ZatChannel.h"
-#include "Settings.h"
 #include "sql/EpgDB.h"
 #include "sql/RecordingsDB.h"
 #include "sql/ParameterDB.h"
 #include "http/HttpClient.h"
 #include "epg/EpgProvider.h"
-#include "Session.h"
 
 class CZattooTVAddon;
 
@@ -27,12 +25,13 @@ struct PVRZattooChannelGroup
   std::vector<ZatChannel> channels;
 };
 
-class ATTRIBUTE_HIDDEN ZatData :  public kodi::addon::CAddonBase,
-                                  public kodi::addon::CInstancePVRClient
+class ATTR_DLL_LOCAL ZatData : public kodi::addon::CInstancePVRClient
 {
 public:
-  ADDON_STATUS Create() override;
-  ZatData();
+  ZatData(const kodi::addon::IInstanceInfo& instance,
+      const std::string& username, const std::string& password, bool favoritesOnly,
+      const STREAM_TYPE& streamType, bool enableDolby, int provider,
+      const std::string& parentalPin);
   ~ZatData();
   bool Initialize();
   bool LoadChannels();
@@ -70,36 +69,48 @@ public:
   PVR_ERROR IsEPGTagRecordable(const kodi::addon::PVREPGTag& tag, bool& isRecordable) override;
   PVR_ERROR GetEPGTagStreamProperties(const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVRStreamProperty>& properties) override;
   PVR_ERROR GetEPGTagEdl(const kodi::addon::PVREPGTag& tag, std::vector<kodi::addon::PVREDLEntry>& edl) override;
-  PVR_ERROR GetRecordingEdl(const kodi::addon::PVRRecording& recording, std::vector<kodi::addon::PVREDLEntry>& edl) override;  
 
   int GetRecallSeconds(const kodi::addon::PVREPGTag& tag);
   void GetEPGForChannelAsync(int uniqueChannelId, time_t iStart, time_t iEnd);
   bool RecordingEnabled()
   {
-    return m_session->IsRecordingEnabled();
+    return m_recordingEnabled;
   }
-  ADDON_STATUS GetStatus() override;
-  void UpdateConnectionState(const std::string& connectionString, PVR_CONNECTION_STATE newState, const std::string& message);
-  bool SessionInitialized();
-  ADDON_STATUS SetSetting(const std::string& settingName,
-                          const kodi::CSettingValue& settingValue) override;
 
 private:
+  bool m_initDone = false;
+  bool m_favoritesOnly;
+  bool m_enableDolby;
+  STREAM_TYPE m_streamType;
+  std::string m_username;
+  std::string m_password;
+  std::string m_appToken;
+  std::string m_powerHash;
+  std::string m_countryCode;
+  std::string m_serviceRegionCountry;
+  bool m_recallEnabled = false;
+  bool m_recordingEnabled = false;
   std::vector<PVRZattooChannelGroup> m_channelGroups;
   std::map<int, ZatChannel> m_channelsByUid;
   std::map<std::string, ZatChannel> m_channelsByCid;
   std::map<std::string, ZatChannel> m_visibleChannelsByCid;
   std::vector<UpdateThread*> m_updateThreads;
   Categories m_categories;
+  std::string m_providerUrl;
+  std::string m_parentalPin;
   EpgDB *m_epgDB;
   RecordingsDB *m_recordingsDB;
   ParameterDB *m_parameterDB;
   HttpClient *m_httpClient;
   EpgProvider *m_epgProvider = nullptr;
-  CSettings* m_settings;
-  Session *m_session;
 
+  bool LoadAppId();
+  bool LoadAppTokenFromTokenJson(std::string tokenJsonPath);
+  bool LoadAppTokenFromFile();
+  bool LoadAppTokenFromJson(std::string html);
+  bool LoadAppTokenFromHtml(std::string html);
   bool ReadDataJson();
+  bool SendHello();
   rapidjson::Document Login();
   bool InitSession(bool isReinit);
   bool ReinitSession();
