<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon  id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="3.5.13" provider-name="croneter">
  <requires>
    <import addon="xbmc.python" version="3.0.0"/>
    <import addon="script.module.requests" version="2.22.0+matrix.1" />
    <import addon="plugin.video.plexkodiconnect.movies" version="3.0.1" />
    <import addon="plugin.video.plexkodiconnect.tvshows" version="3.0.1" />
    <import addon="metadata.themoviedb.org.python" version="1.3.1+matrix.1" />
  </requires>
  <extension point="xbmc.python.pluginsource" library="default.py">
        <provides>video audio image</provides>
  </extension>
  <extension point="xbmc.service" library="service.py" start="login">
  </extension>
  <extension point="kodi.context.item" library="contextmenu.py">
      <item>
        <label>30401</label>
              <description>30416</description>
              <visible>[!IsEmpty(ListItem.DBID) + !StringCompare(ListItem.DBID,-1) | !IsEmpty(ListItem.Property(plexid))]</visible>
      </item>
  </extension>
  <extension point="xbmc.addon.metadata">
    <assets>
        <icon>icon.png</icon>
        <fanart>fanart.jpg</fanart>
    </assets>
    <summary lang="en">Native Integration of Plex into Kodi</summary>
    <description lang="en">Connect Kodi to your Plex Media Server. This plugin assumes that you manage all your videos with Plex (and none with Kodi). You might lose data already stored in the Kodi video and music databases (as this plugin directly changes them). Use at your own risk!</description>
    <disclaimer lang="en">Use at your own risk</disclaimer>
    <platform>all</platform>
    <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
    <forum>https://forums.plex.tv</forum>
    <website>https://github.com/croneter/PlexKodiConnect</website>
    <email></email>
    <source>https://github.com/croneter/PlexKodiConnect</source>
    <summary lang="nl_NL">Directe integratie van Plex in Kodi</summary>
    <description lang="nl_NL">Verbind Kodi met je Plex Media Server. Deze plugin gaat ervan uit dat je al je video's met Plex (en niet met Kodi) beheerd. Je kunt gegevens reeds opgeslagen in de databases voor video en muziek van Kodi (deze plugin wijzigt deze gegevens direct) verliezen. Gebruik op eigen risico!</description>
    <disclaimer lang="nl_NL">Gebruik op eigen risico</disclaimer>
    <summary lang="fr_CA">Intégration native de Plex dans Kodi</summary>
    <description lang="fr_CA">Connecter Kodi à votre Plex Media Server. Ce plugin assume que vous souhaitez gérer toutes vos vidéos avec Plex (et aucune avec Kodi). Vous pourriez perdre les données déjà stockées dans les bases de données vidéo et musique de Kodi (ce plugin les modifie directement). Utilisez à vos propres risques !</description>
    <disclaimer lang="fr_CA">A utiliser à vos propres risques</disclaimer>
    <summary lang="fr_FR">Intégration native de Plex dans Kodi</summary>
    <description lang="fr_FR">Connecter Kodi à votre Plex Media Server. Ce plugin assume que vous souhaitez gérer toutes vos vidéos avec Plex (et aucune avec Kodi). Vous pourriez perdre les données déjà stockées dans les bases de données vidéo et musique de Kodi (ce plugin les modifie directement). Utilisez à vos propres risques !</description>
    <disclaimer lang="fr_FR">A utiliser à vos propres risques</disclaimer>
    <summary lang="de_DE">Komplette Integration von Plex in Kodi</summary>
    <description lang="de_DE">Verbindet Kodi mit deinem Plex Media Server. Dieses Addon geht davon aus, dass du all deine Videos mit Plex verwaltest (und keine direkt mit Kodi). Du wirst möglicherweise Daten verlieren, die bereits in der Kodi Video- und/oder Musik-Datenbank gespeichert sind (da dieses Addon beide Datenbanken direkt verändert). Benutzung auf eigene Gefahr!</description>
    <disclaimer lang="de_DE">Benutzung auf eigene Gefahr</disclaimer>
    <summary lang="pt_PT">Integração nativa do Plex no Kodi</summary>
    <description lang="pt_PT">Conectar o Kodi ao Servidor Plex Media. Este plugin assume que gerirá todos os vídeos com o Plex (e nenhum com Kodi). Poderá perder dados guardados nas bases de dados de vídeo e musica do Kodi (pois este plugin interfere diretamente com as mesmas). Use por risco de conta própria</description>
    <disclaimer lang="pt_PT">Use por risco de conta própria</disclaimer>
    <summary lang="pt_BR">Integração nativa do Plex no Kodi</summary>
    <description lang="pt_BR">Conectar o Kodi ao Servidor Plex Media. Este plugin assume que gerirá todos os vídeos com o Plex (e nenhum com Kodi). Poderá perder dados guardados nas bases de dados de vídeo e musica do Kodi (pois este plugin interfere diretamente com as mesmas). Use por risco de conta própria</description>
    <disclaimer lang="pt_BR">Use por risco de conta própria</disclaimer>
    <summary lang="es_ES">Integración Nativa de Plex en Kodi</summary>
    <description lang="es_ES">Conecte Kodi a su Plex Media Server.  Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo!</description>
    <disclaimer lang="es_ES">Usar a su propio riesgo</disclaimer>
    <summary lang="es_AR">Integración Nativa de Plex en Kodi</summary>
    <description lang="es_AR">Conecte Kodi a su Plex Media Server.  Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo!</description>
    <disclaimer lang="es_AR">Usar a su propio riesgo</disclaimer>
    <summary lang="es_MX">Integración Nativa de Plex en Kodi</summary>
    <description lang="es_MX">Conecte Kodi a su Plex Media Server.  Este plugin asume que usted gestiona todos sus vídeos con Plex (y ninguno con Kodi). Puede perder datos ya guardados en las bases de datos de vídeo y música de Kodi (ya que este plugin las actualiza directamente). ¡Úselo a su propio riesgo!</description>
    <disclaimer lang="es_MX">Usar a su propio riesgo</disclaimer>
    <summary lang="cs_CZ">Úplná integrace Plexu do Kodi</summary>
    <description lang="cs_CZ">Připojte Kodi ke svému Plex Media Serveru. Tento doplněk předpokládá, že spravujete veškerá svá videa pomocí Plexu (nikoliv pomocí Kodi). Můžete přijít o data uložená ve video a hudební databázi Kodi (tento doplněk je přímo mění). Používejte na vlastní nebezpečí!</description>
    <disclaimer lang="cs_CZ">Používejte na vlastní nebezpečí</disclaimer>
    <summary lang="da_DK">Indbygget Integration af Plex i Kodi</summary>
    <description lang="da_DK">Tilslut Kodi til din Plex Media Server. Dette plugin forudsætter, at du administrere alle dine videoer med Plex (og ikke med Kodi). Du kan miste data som allerede er gemt i Kodi video og musik-databaser (dette plugin ændrer direkte i dem). Brug på eget ansvar!</description>
    <disclaimer lang="da_DK">Brug på eget ansvar</disclaimer>
    <summary lang="it_IT">Integrazione nativa di Plex su Kodi</summary>
    <description lang="it_IT">Connetti Kodi al tuo Plex Media Server. Questo plugin assume che tu gestisca tutti i video con Plex (e non con Kodi). Potresti perdere i dati dei film e della musica già memorizzati nel database di Kodi (questo plugin modifica direttamente il database stesso). Usa a tuo rischio e pericolo!</description>
    <disclaimer lang="it_IT">Usa a tuo rischio e pericolo</disclaimer>
    <summary lang="no_NO">Naturlig integrasjon av Plex til Kodi</summary>
    <description lang="no_NO">Koble Kodi til din Plex Media Server. Denne plugin forventer at du organiserer alle dine videor med Plex (og ingen med Kodi). Du kan miste all data allerede lagret i Kodi video- og musikkdatabasene (da denne plugin umiddelbart forandrer dem). Bruk på egen risiko!</description>
    <disclaimer lang="no_NO">Bruk på eget ansvar</disclaimer>
    <summary lang="hu_HU">a Plex natív integrációja a Kodi-ba</summary>
    <description lang="hu_HU">Csatlakoztassa a Kodi-t a Plex médiaszerveréhez. Ez a kiegészítő feltételezi, hogy az összes videóját a Plex-szel kezeli (és egyiket sem a Kodi-val). Elveszítheti a már a Kodi videó- és zene-adatbázisában tárolt adatokat (mivel ez a kiegészítő közvetlenül módosítja az adatbázisokat). Csak saját felelősségére használja!</description>
    <disclaimer lang="hu_HU">Csak saját felelősségre használja</disclaimer>
    <summary lang="ru_RU">Нативная интеграция сервера Plex в Kodi</summary>
    <description lang="ru_RU">Подключите Kodi к своему серверу Plex. Плагин предполагает что вы управляете своими видео с помощью Plex (а не в Kodi). Вы можете потерять текущие базы данных музыки и видео в Kodi (так как плагин напрямую их изменяет). Используйте на свой страх и риск</description>
    <disclaimer lang="ru_RU">Используйте на свой страх и риск</disclaimer>
    <summary lang="uk_UA">Нативна інтеграція Plex в Kodi</summary>
    <description lang="uk_UA">Підключає Kodi до серверу Plex. Цей плагін передбачає, що ви керуєте всіма своїми відео за допомогою Plex (і ніяк не Kodi). Ви можете втратити дані, які вже зберігаються у відео та музичних БД Kodi (оскільки цей плагін безпосередньо їх змінює). Використовуйте на свій страх і ризик!</description>
    <disclaimer lang="uk_UA">Використовуйте на свій ризик</disclaimer>
    <disclaimer lang="lv_LV">Lieto uz savu atbildību</disclaimer>
    <summary lang="sv_SE">Inbyggd integrering av Plex i Kodi</summary>
    <description lang="sv_SE">Anslut Kodi till din Plex Media Server. Detta tillägg antar att du hanterar alla dina filmer med Plex (och ingen med Kodi). Du kan förlora data redan sparad i Kodis video och musik databaser (eftersom detta tillägg direkt ändrar dem). Använd på egen risk!</description>
    <disclaimer lang="sv_SE">Använd på egen risk</disclaimer>
    <summary lang="lt_LT">Natūralioji „Plex“ integracija į „Kodi“</summary>
    <description lang="lt_LT">Prijunkite „Kodi“ prie „Plex Medija Serverio“. Šiame papildinyje daroma prielaida, kad valdote visus savo vaizdo įrašus naudodami „Plex“ (ir nė vieno su „Kodi“). Galite prarasti jau saugomus „Kodi“ vaizdo įrašų ir muzikos duomenų bazių duomenis (kadangi šis papildinys juos tiesiogiai pakeičia). Naudokite savo pačių rizika!</description>
    <disclaimer lang="lt_LT">Naudokite savo pačių rizika</disclaimer>
    <summary lang="ko_KR">Plex를 Kodi에 기본 통합</summary>
    <description lang="ko_KR">Kodi를 Plex Media Server에 연결합니다. 이 플러그인은 Plex로 모든 비디오를 관리하고 Kodi로는 관리하지 않는다고 가정합니다. Kodi 비디오 및 음악 데이터베이스에 이미 저장된 데이터가 손실 될 수 있습니다 (이 플러그인이 직접 변경하므로). 자신의 책임하에 사용하십시오!</description>
    <disclaimer lang="ko_KR">자신의 책임하에 사용</disclaimer>
    <news>version 3.5.13 (beta only):
- Fix Kodi getting blocked and losing PMS access e.g. due to cloudflare

version 3.5.12 (beta only):
- Fix skip intro not working
- Fix playback report not working due to an IndexError
- Fix rare IndexError when trying to delete a playlist item

version 3.5.11 (beta only):
- Fix playback startup and AttributeError: 'bool' object has no attribute 'get'

version 3.5.10 (beta only):
- Tell the PMS and Plex Companion about any stream changes on the Kodi side

version 3.5.9 (beta only):
- Huge overhaul: completely new Plex Companion implementation. PKC is now available as a casting target for Plexamp. Includes refactoring of Skip Intro as well as Playqueues
- Add auto skip intro functionality
- Fix streams for videos not being set-up
- Fix generating new unique device ID for PKC not working
- Make PKC compatible with Python 3.6 again

version 3.5.8:
- Fix UnboundLocalError: local variable 'identifier' referenced before assignment
- versions 3.5.6-3.5.7 for everyone

version 3.5.7 (beta only):
- Fix Kodi JSON racing condition on playback startup and KeyError

version 3.5.6 (beta only):
- Fix Plex Companion not working by fixing some issues with PKC's http.server's BaseHTTPRequestHandler

version 3.5.5:
- Lost patience with Kodi 19: drop use of Python multiprocessing entirely

version 3.5.4:
- Fix Receiving init() missing 1 required positional argument: ‘certification_country’
- Update translations from Transifex

version 3.5.3:
- Add playback settings to let the user choose whether Plex or Kodi provides the default audio or subtitle stream on playback start

version 3.5.2:
- version 3.5.1 for everyone

version 3.5.1 (beta only):
- Refactor stream code and fix Kodi not activating subtitle when it should
- Direct Paths: Fix TypeError: "element indices must be integers" on playback startup
- Android: Fix broken Python multiprocessing module (a Kodi 19.2 bug) 
- Fix logging if fanart.tv lookup fails: be less verbose

version 3.5.0:
- versions 3.4.5-3.4.7 for everyone

version 3.4.7 (beta only):
- Tell the PMS if a video's audio stream or potentially subtitle stream has changed. For subtitles, this functionality is broken due to a Kodi bug
- Transcoding: Fix Plex burning-in subtitles when it should not
- Large refactoring of playlist and playqueue code
- Refactor usage of a media part's id

version 3.4.6 (beta only):
- Fix RecursionError if a video lies in a root directory

version 3.4.5 (beta only):
- Implement "Reset resume position" from the Kodi context menu

version 3.4.4:
- Initial compatibility with Kodi 20 Nexus. Keep in mind that development for Kodi Nexus has not even officially reached alpha stage - any issues you encounter are probably caused by that
- version 3.4.3 for everyone

version 3.4.3 (beta ony):
- Use Plex settings for audio and subtitle stream selection. This is a best guess regarding subtitles as Plex and Kodi are not sharing much info
- Fix PlexKodiConnect setting the Plex subtitle to None
- Download landscape artwork from fanart.tv, thanks @geropan
- Revert "Fix PlexKodiConnect changing subtitles for all videos on the PMS"

version 3.4.2:
- Fix PlexKodiConnect changing or removing subtitles for every video on the PMS

version 3.4.1:
- Fix PMS setting `List of IP addresses and networks that are allowed without auth` causing Kodi to take forever to start playback

version 3.4.0:
- Improve logging for converting Unix timestamps
- Remove dependency on script.module.defusedxml - that module is now included in PKC
- version 3.3.3-3.3.5 for everyone

version 3.3.5 (beta only):
- Rewire defusedxml and xml.etree.ElementTree: Fix AttributeError: module 'resources.lib.utils' has no attribute 'ParseError'
- Fix errors when PKC tries to edit files that don't exist yet

version 3.3.4 (beta only):
- Fix a racing condition that could lead to the sync getting stuck
- Fix RecursionError: maximum recursion depth exceeded
- Bump websocket client: fix AttributeError: 'NoneType' object has no attribute 'is_ssl'

version 3.3.3 (beta only):
- Fix a racing condition that could lead to the sync process getting stuck
- Fix likelyhood of `database is locked` error occuring
- Fix AttributeError: module 'urllib' has no attribute 'parse'
- Support for the Plex HAMA agent to let Kodi identify animes (using Kodi's uniqueID 'anidb')
- Support forced HAMA IDs when using tvdb uniqueID

version 3.3.2:
- version 3.3.1 for everyone

version 3.3.1 (beta only):
- Add an additional Plex Hub "PKC Continue Watching" that merges the Plex Continue Watching with On Deck
- Fix auto-picking of video stream if several video versions are available
- Make PKC compatible with Kodi 20 N* by using xbmcvfs for translatePath
- Update translations

version 3.3.0:
WARNING: Database reset and full resync required
- versions 3.2.1-3.2.4 for everyone

version 3.2.4 (beta only):
- Fix websockets and AttributeError: 'NoneType' object has no attribute

version 3.2.3 (beta only):
- Attempt to fix websocket threading issues and AttributeError: 'NoneType' object has no attribute 'is_ssl' or 'settimeout'
- Get rid of Python arrow; hopefully fix many Python import errors (also occuring in other add-ons!)

version 3.2.2 (beta only):
- Fix videos not starting due to a TypeError
- Show warning message to remind user to use Estuary for database resets
- Update websocket client to 1.0.0

version 3.2.1 (beta only):
WARNING: Database reset and full resync required
- Fix PKC widgets not working at all in some cases
- Direct Paths: fix several issues with episodes
- New Python-dependency: arrow

version 3.2.0:
WARNING: Database reset and full resync required
- version 3.1.1-3.1.4 for everyone

version 3.1.4 (beta only):
- Fix Alexa and RuntimeError: dictionary keys changed during iteration
- Fix AttributeError: module 'shutil' has no attribute 'copy_tree'

version 3.1.3 (beta only):
- Add PKC setting to disable verification whether we can access a media file
- Direct paths: corrections to more closely mirror Kodi's way of saving movie and tv show files to the db
- Make sure that the correct file system encoding is used for playlists
- Fix a rare AttributeError when using playlists
- Fix regression: fix add-on paths always falling back to direct paths

version 3.1.2 (beta only):
- Fix ImportError: cannot import name 'dir_util' from 'distutils' on PKC startup
- Fix UnicodeEncodeError if Plex playlist name contains illegal chars
- Fix PKC not showing up as a casting target in some cases

version 3.1.1 (beta only):
- Direct paths: fix filename showing instead of full video metadata during playback
- Update translations

version 3.1.0:
- version 3.0.16 and 3.0.17 for everyone
- Fix resume not working if Kodi player start-up is slow

version 3.0.17 (beta only):
- Fix instantaneous background sync and Alexa not working
- Hopefully fix RuntimeError: no add-on id "plugin.video.plexkodiconnect"
- Fix error socket.timeout: timed out 

version 3.0.16 (beta only):
- Add information to PKC settings for background sync and Alexa whether a connection has been successfully made 

version 3.0.15:
- 3.0.14 for everyone
- Rename skip intro skin file

version 3.0.14 (beta only):
- Quickly sync recently watched items before synching the playstates of the entire Plex library
- Fix TypeError: function missing required argument 'message'
- Fix PlexKodiConnect Kodi add-on icon and fanart not showing
- Improve logging for websocket JSON loads

version 3.0.13:
- Fix UnboundLocalError: local variable 'user' referenced before assignment

version 3.0.12:
- Sync name and user rating of a TV show season to Kodi
- Fix rare TypeError: expected string or buffer on playback start

version 3.0.11:
- Fix TypeError: function missing required argument 'message'

version 3.0.10:
- Fix skip intros sometimes not working due to a RuntimeError
- Update translations

version 3.0.9:
- Add skip intro functionality
- Fix Kodi add-on NextUp not working

version 3.0.8:
- Fix KeyError: u'game' if Plex Arcade has been activated
- Fix AttributeError: 'App' object has no attribute 'threads' when sync is cancelled

version 3.0.7:
- Hopefully fix rare case when sync would get stuck indefinitely
- Fix ValueError: invalid literal for int() for invalid dates sent by Plex

version 3.0.6:
- Fix PKC not auto-picking audio/subtitle stream when transcoding
- Fix ValueError when deleting a music album
- Fix OSError: Invalid argument when Plex returns an invalid timestamp

version 3.0.5:
- Fix pictures from Plex picture libraries not working/displaying
- Fix sqlite3.OperationalError on PKC upgrade

version 3.0.4:
- Automatically look for missing movie trailers using TMDB

version 3.0.3:
- Fix PKC suddenly using main Plex user's credentials, e.g. when the PMS address changed
- Fix missing Kodi tags for movie collections/sets
- Change `thread.isAlive` to `thread.is_alive`

version 3.0.2:
- Fix AttributeError: module has no attribute try_decode

version 3.0.1:
- Fix rare KeyError when using PKC widgets
- Update translations

version 3.0.0:
- Major upgrade from Python 2 to Python 3, allowing use of Kodi 19 Matrix
</news>
  </extension>
</addon>
