commit
8c60050bcd
9 changed files with 32 additions and 20 deletions
|
@ -1,12 +1,12 @@
|
||||||
[![stable version](https://img.shields.io/badge/stable_version-2.8.5-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip)
|
[![stable version](https://img.shields.io/badge/stable_version-2.8.6-blue.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/stable/repository.plexkodiconnect/repository.plexkodiconnect-1.0.2.zip)
|
||||||
[![beta version](https://img.shields.io/badge/beta_version-2.8.5-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip)
|
[![beta version](https://img.shields.io/badge/beta_version-2.8.6-red.svg?maxAge=60&style=flat) ](https://github.com/croneter/binary_repo/raw/master/beta/repository.plexkodiconnectbeta/repository.plexkodiconnectbeta-1.0.2.zip)
|
||||||
|
|
||||||
[![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation)
|
[![Installation](https://img.shields.io/badge/wiki-installation-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/Installation)
|
||||||
[![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq)
|
[![FAQ](https://img.shields.io/badge/wiki-FAQ-brightgreen.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/wiki/faq)
|
||||||
[![Forum](https://img.shields.io/badge/forum-plex-orange.svg?maxAge=60&style=flat)](https://forums.plex.tv/discussion/210023/plexkodiconnect-let-kodi-talk-to-your-plex)
|
[![Forum](https://img.shields.io/badge/forum-plex-orange.svg?maxAge=60&style=flat)](https://forums.plex.tv/discussion/210023/plexkodiconnect-let-kodi-talk-to-your-plex)
|
||||||
[![Donate](https://img.shields.io/badge/donate-kofi-blue.svg)](https://ko-fi.com/A8182EB)
|
[![Donate](https://img.shields.io/badge/donate-kofi-blue.svg)](https://ko-fi.com/A8182EB)
|
||||||
|
|
||||||
[![GitHub issues](https://img.shields.io/github/issues/croneter/PlexKodiConnect.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/croneter/PlexKodiConnect.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/pulls) [![HitCount](http://hits.dwyl.io/croneter/PlexKodiConnect.svg)](http://hits.dwyl.io/croneter/PlexKodiConnect) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a66870f19ced4fb98f94d9fd56e34e87)](https://www.codacy.com/app/croneter/PlexKodiConnect?utm_source=github.com&utm_medium=referral&utm_content=croneter/PlexKodiConnect&utm_campaign=Badge_Grade)
|
[![GitHub issues](https://img.shields.io/github/issues/croneter/PlexKodiConnect.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/croneter/PlexKodiConnect.svg?maxAge=60&style=flat)](https://github.com/croneter/PlexKodiConnect/pulls) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a66870f19ced4fb98f94d9fd56e34e87)](https://www.codacy.com/app/croneter/PlexKodiConnect?utm_source=github.com&utm_medium=referral&utm_content=croneter/PlexKodiConnect&utm_campaign=Badge_Grade)
|
||||||
|
|
||||||
|
|
||||||
# PlexKodiConnect (PKC)
|
# PlexKodiConnect (PKC)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="2.8.5" provider-name="croneter">
|
<addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="2.8.6" provider-name="croneter">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.1.0"/>
|
<import addon="xbmc.python" version="2.1.0"/>
|
||||||
<import addon="script.module.requests" version="2.9.1" />
|
<import addon="script.module.requests" version="2.9.1" />
|
||||||
|
@ -77,7 +77,11 @@
|
||||||
<summary lang="uk_UA">Нативна інтеграція Plex в Kodi</summary>
|
<summary lang="uk_UA">Нативна інтеграція Plex в Kodi</summary>
|
||||||
<description lang="uk_UA">Підключає Kodi до серверу Plex. Цей плагін передбачає, що ви керуєте всіма своїми відео за допомогою Plex (і ніяк не Kodi). Ви можете втратити дані, які вже зберігаються у відео та музичних БД Kodi (оскільки цей плагін безпосередньо їх змінює). Використовуйте на свій страх і ризик!</description>
|
<description lang="uk_UA">Підключає Kodi до серверу Plex. Цей плагін передбачає, що ви керуєте всіма своїми відео за допомогою Plex (і ніяк не Kodi). Ви можете втратити дані, які вже зберігаються у відео та музичних БД Kodi (оскільки цей плагін безпосередньо їх змінює). Використовуйте на свій страх і ризик!</description>
|
||||||
<disclaimer lang="uk_UA">Використовуйте на свій ризик</disclaimer>
|
<disclaimer lang="uk_UA">Використовуйте на свій ризик</disclaimer>
|
||||||
<news>version 2.8.5:
|
<news>version 2.8.6:
|
||||||
|
- Fix PKC creating thousands of playlists if a single Kodi playlist wasn't unique
|
||||||
|
- Fix FutureWarning
|
||||||
|
|
||||||
|
version 2.8.5:
|
||||||
- Fix Trakt add-on not recognizing id of tv shows (you will need to manually reset the Kodi database in the PKC settings under Advanced)
|
- Fix Trakt add-on not recognizing id of tv shows (you will need to manually reset the Kodi database in the PKC settings under Advanced)
|
||||||
- Update translations
|
- Update translations
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
version 2.8.6:
|
||||||
|
- Fix PKC creating thousands of playlists if a single Kodi playlist wasn't unique
|
||||||
|
- Fix FutureWarning
|
||||||
|
|
||||||
version 2.8.5:
|
version 2.8.5:
|
||||||
- Fix Trakt add-on not recognizing id of tv shows (you will need to manually reset the Kodi database in the PKC settings under Advanced)
|
- Fix Trakt add-on not recognizing id of tv shows (you will need to manually reset the Kodi database in the PKC settings under Advanced)
|
||||||
- Update translations
|
- Update translations
|
||||||
|
|
|
@ -483,7 +483,7 @@ def extras(plex_id):
|
||||||
xbmcplugin.endOfDirectory(int(sys.argv[1]))
|
xbmcplugin.endOfDirectory(int(sys.argv[1]))
|
||||||
return
|
return
|
||||||
extras = API(xml[0]).extras()
|
extras = API(xml[0]).extras()
|
||||||
if not extras:
|
if extras is None:
|
||||||
return
|
return
|
||||||
for child in xml:
|
for child in xml:
|
||||||
xml.remove(child)
|
xml.remove(child)
|
||||||
|
|
|
@ -42,4 +42,13 @@ def check_migration():
|
||||||
sections.clear_window_vars()
|
sections.clear_window_vars()
|
||||||
sections.delete_videonode_files()
|
sections.delete_videonode_files()
|
||||||
|
|
||||||
|
if not utils.compare_version(last_migration, '2.8.7'):
|
||||||
|
LOG.info('Migrating to version 2.8.6')
|
||||||
|
# Need to delete the UNIQUE index that prevents creating several
|
||||||
|
# playlist entries with the same kodi_hash
|
||||||
|
from .plex_db import PlexDB
|
||||||
|
with PlexDB() as plexdb:
|
||||||
|
plexdb.cursor.execute('DROP INDEX IF EXISTS ix_playlists_3')
|
||||||
|
# Index will be automatically recreated on next PKC startup
|
||||||
|
|
||||||
utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION)
|
utils.settings('last_migrated_PKC_version', value=v.ADDON_VERSION)
|
||||||
|
|
|
@ -47,15 +47,13 @@ def update_playlist(playlist, delete=False):
|
||||||
plexdb.add_playlist(playlist)
|
plexdb.add_playlist(playlist)
|
||||||
|
|
||||||
|
|
||||||
def get_playlist(path=None, kodi_hash=None, plex_id=None):
|
def get_playlist(path=None, plex_id=None):
|
||||||
"""
|
"""
|
||||||
Returns the playlist as a Playlist for either the plex_id, path or
|
Returns the playlist as a Playlist for either the plex_id or path
|
||||||
kodi_hash. kodi_hash will be more reliable as it includes path and file
|
|
||||||
content.
|
|
||||||
"""
|
"""
|
||||||
playlist = Playlist()
|
playlist = Playlist()
|
||||||
with PlexDB() as plexdb:
|
with PlexDB() as plexdb:
|
||||||
playlist = plexdb.playlist(playlist, plex_id, path, kodi_hash)
|
playlist = plexdb.playlist(playlist, plex_id, path)
|
||||||
return playlist
|
return playlist
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -561,7 +561,7 @@ class Base(object):
|
||||||
Returns None if no extras are found
|
Returns None if no extras are found
|
||||||
"""
|
"""
|
||||||
extras = self.xml.find('Extras')
|
extras = self.xml.find('Extras')
|
||||||
if not extras:
|
if extras is None:
|
||||||
return
|
return
|
||||||
return (x for x in extras)
|
return (x for x in extras)
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ def initialize():
|
||||||
'CREATE INDEX IF NOT EXISTS ix_track_1 ON track (last_sync)',
|
'CREATE INDEX IF NOT EXISTS ix_track_1 ON track (last_sync)',
|
||||||
'CREATE UNIQUE INDEX IF NOT EXISTS ix_track_2 ON track (kodi_id)',
|
'CREATE UNIQUE INDEX IF NOT EXISTS ix_track_2 ON track (kodi_id)',
|
||||||
'CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_2 ON playlists (kodi_path)',
|
'CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_2 ON playlists (kodi_path)',
|
||||||
'CREATE UNIQUE INDEX IF NOT EXISTS ix_playlists_3 ON playlists (kodi_hash)',
|
'CREATE INDEX IF NOT EXISTS ix_playlists_3 ON playlists (kodi_hash)',
|
||||||
)
|
)
|
||||||
for cmd in commands:
|
for cmd in commands:
|
||||||
plexdb.cursor.execute(cmd)
|
plexdb.cursor.execute(cmd)
|
||||||
|
|
|
@ -57,20 +57,17 @@ class Playlists(object):
|
||||||
playlist.kodi_type,
|
playlist.kodi_type,
|
||||||
playlist.kodi_hash))
|
playlist.kodi_hash))
|
||||||
|
|
||||||
def playlist(self, playlist, plex_id=None, path=None, kodi_hash=None):
|
def playlist(self, playlist, plex_id=None, path=None):
|
||||||
"""
|
"""
|
||||||
Returns a complete Playlist (empty one passed in via playlist)
|
Returns a complete Playlist (empty one passed in via playlist) for the
|
||||||
for the entry with plex_id OR kodi_hash OR kodi_path.
|
entry with plex_id OR kodi_path.
|
||||||
Returns None if not found
|
Returns None if not found
|
||||||
"""
|
"""
|
||||||
query = 'SELECT * FROM playlists WHERE %s = ? LIMIT 1'
|
query = 'SELECT * FROM playlists WHERE %s = ? LIMIT 1'
|
||||||
if plex_id:
|
if plex_id:
|
||||||
query = query % 'plex_id'
|
query = query % 'plex_id'
|
||||||
var = plex_id
|
var = plex_id
|
||||||
elif kodi_hash:
|
elif path:
|
||||||
query = query % 'kodi_hash'
|
|
||||||
var = kodi_hash
|
|
||||||
else:
|
|
||||||
query = query % 'kodi_path'
|
query = query % 'kodi_path'
|
||||||
var = path
|
var = path
|
||||||
self.cursor.execute(query, (var, ))
|
self.cursor.execute(query, (var, ))
|
||||||
|
|
Loading…
Reference in a new issue