Merge pull request #653 from croneter/beta-version

Bump stable version
This commit is contained in:
croneter 2019-01-30 18:31:38 +01:00 committed by GitHub
commit ad607f61e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 152 additions and 119 deletions

View file

@ -1,5 +1,5 @@
[![stable version](https://img.shields.io/badge/stable_version-2.6.0-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.6.1-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.6.0-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.6.1-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)

View file

@ -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.6.0" provider-name="croneter"> <addon id="plugin.video.plexkodiconnect" name="PlexKodiConnect" version="2.6.1" 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,14 @@
<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.6.0: <news>version 2.6.1:
- WARNING: You will need to reset the Kodi database!
- Fix TV sections not being deleted e.g. after user switch
- Don't show a library sync error pop-up when full sync is interrupted
- Fix to correctly escape paths
- Update translations
version 2.6.0:
- Support for Kodi 18 Leia - Support for Kodi 18 Leia
- Big overhaul of the synching process, it's now much faster - Big overhaul of the synching process, it's now much faster
- PKC now supports really big Plex and Kodi libraries - PKC now supports really big Plex and Kodi libraries

View file

@ -1,3 +1,10 @@
version 2.6.1:
- WARNING: You will need to reset the Kodi database!
- Fix TV sections not being deleted e.g. after user switch
- Don't show a library sync error pop-up when full sync is interrupted
- Fix to correctly escape paths
- Update translations
version 2.6.0: version 2.6.0:
- Support for Kodi 18 Leia - Support for Kodi 18 Leia
- Big overhaul of the synching process, it's now much faster - Big overhaul of the synching process, it's now much faster

View file

@ -1,6 +1,6 @@
# XBMC Media Center language file # XBMC Media Center language file
# Translators: # Translators:
# Croneter None <croneter@gmail.com>, 2018 # Croneter None <croneter@gmail.com>, 2019
# #
msgid "" msgid ""
msgstr "" msgstr ""
@ -8,7 +8,7 @@ msgstr ""
"Report-Msgid-Bugs-To: croneter@gmail.com\n" "Report-Msgid-Bugs-To: croneter@gmail.com\n"
"POT-Creation-Date: 2017-04-15 13:13+0000\n" "POT-Creation-Date: 2017-04-15 13:13+0000\n"
"PO-Revision-Date: 2017-04-30 08:30+0000\n" "PO-Revision-Date: 2017-04-30 08:30+0000\n"
"Last-Translator: Croneter None <croneter@gmail.com>, 2018\n" "Last-Translator: Croneter None <croneter@gmail.com>, 2019\n"
"Language-Team: Hungarian (Hungary) (https://www.transifex.com/croneter/teams/73837/hu_HU/)\n" "Language-Team: Hungarian (Hungary) (https://www.transifex.com/croneter/teams/73837/hu_HU/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -97,7 +97,7 @@ msgstr "Kapcsolat"
# Pop-up notification if user tried to manually initiate fanart download # Pop-up notification if user tried to manually initiate fanart download
msgctxt "#30015" msgctxt "#30015"
msgid "Fanart download already running" msgid "Fanart download already running"
msgstr "" msgstr "Már fut a művészképek letöltése"
msgctxt "#30016" msgctxt "#30016"
msgid "Device Name" msgid "Device Name"
@ -159,7 +159,7 @@ msgstr "Kodi lejátszási lista előtag szinkronizálásra kijelöléshez"
# PKC settings artwork options: status info # PKC settings artwork options: status info
msgctxt "#30028" msgctxt "#30028"
msgid "PKC-only image caching completed" msgid "PKC-only image caching completed"
msgstr "" msgstr "PKC képek gyorsítótárazása befejeződött"
msgctxt "#30030" msgctxt "#30030"
msgid "Port Number" msgid "Port Number"
@ -322,12 +322,15 @@ msgid ""
"In the following window, enter the server's hostname (or IP) where your Plex" "In the following window, enter the server's hostname (or IP) where your Plex"
" media resides. Mind the case!" " media resides. Mind the case!"
msgstr "" msgstr ""
"A következő ablakban adja meg a szerver kiszolgálónevét (vagy IP címét) "
"amelyen a Plex médiatartalmak megtalálhatók. Figyeljen a kis- és "
"nagybetűkre!"
# For setting up direct paths and adding network credentials - input window # For setting up direct paths and adding network credentials - input window
# for hostname # for hostname
msgctxt "#30201" msgctxt "#30201"
msgid "Enter server hostname (or IP)" msgid "Enter server hostname (or IP)"
msgstr "" msgstr "Adja meg a szerver kiszolgálónevét (vagy IP címét)"
# For setting up direct paths and adding network credentials # For setting up direct paths and adding network credentials
msgctxt "#30202" msgctxt "#30202"
@ -335,22 +338,24 @@ msgid ""
"In the following window, enter the network protocol you would like to use. " "In the following window, enter the network protocol you would like to use. "
"This is likely 'smb'." "This is likely 'smb'."
msgstr "" msgstr ""
"A következő ablakban adja meg a használni kívánt hálózati protokollt. Ez "
"valószínűleg az 'smb'."
# For setting up direct paths and adding network credentials - input window # For setting up direct paths and adding network credentials - input window
# protocol # protocol
msgctxt "#30203" msgctxt "#30203"
msgid "Enter network protocol" msgid "Enter network protocol"
msgstr "" msgstr "Adja meg a hálózati protokollt"
# For setting up direct paths and adding network credentials # For setting up direct paths and adding network credentials
msgctxt "#30204" msgctxt "#30204"
msgid "The hostname or IP '{0}' that you entered is not valid." msgid "The hostname or IP '{0}' that you entered is not valid."
msgstr "" msgstr "A megadott kiszolgálónév vagy IP cím '{0}' helytelen."
# For setting up direct paths and adding network credentials # For setting up direct paths and adding network credentials
msgctxt "#30205" msgctxt "#30205"
msgid "The protocol '{0}' that you entered is not supported." msgid "The protocol '{0}' that you entered is not supported."
msgstr "" msgstr "A megadott hálózati protokoll ('{0}') nem támogatott."
# Video node naming for random e.g. movies # Video node naming for random e.g. movies
msgctxt "#30227" msgctxt "#30227"
@ -469,6 +474,8 @@ msgid ""
"Could not change the Kodi settings file {0}. PKC might not work correctly. " "Could not change the Kodi settings file {0}. PKC might not work correctly. "
"Error: {1}" "Error: {1}"
msgstr "" msgstr ""
"A {0} Kodi beállításfájl megváltoztatása sikertelen. Lehet, hogy a PKC nem "
"fog megfelelően működni.Hiba: {1}"
# PKC Settings - Connection # PKC Settings - Connection
msgctxt "#30500" msgctxt "#30500"
@ -483,7 +490,7 @@ msgstr "Kliens SSL tanúsítvány"
# PKC Settings - Artwork # PKC Settings - Artwork
msgctxt "#30502" msgctxt "#30502"
msgid "Sync Plex artwork from the PMS (recommended)" msgid "Sync Plex artwork from the PMS (recommended)"
msgstr "" msgstr "Plex művészképek szinkronizálása a szerverről (ajánlott)"
# PKC Settings, category name # PKC Settings, category name
msgctxt "#30506" msgctxt "#30506"
@ -545,6 +552,8 @@ msgstr "Lejátszás"
msgctxt "#30517" msgctxt "#30517"
msgid "Set network credentials for Direct Paths and direct play" msgid "Set network credentials for Direct Paths and direct play"
msgstr "" msgstr ""
"Hálózati hozzáférési adatok megadása a közvetlen útvonalakhoz és közvetlen "
"lejátszáshoz"
# PKC Settings - Playback # PKC Settings - Playback
msgctxt "#30518" msgctxt "#30518"
@ -575,6 +584,8 @@ msgstr "h265/HEVC transzkódolás kényszerítése"
msgctxt "#30523" msgctxt "#30523"
msgid "Also show sync progress for playstate and user data" msgid "Also show sync progress for playstate and user data"
msgstr "" msgstr ""
"Szinkronizálási folyamat állapotának mutatása a lejátszási- és felhasználói "
"adatok esetén is"
# PKC Settings - Playback # PKC Settings - Playback
msgctxt "#30527" msgctxt "#30527"
@ -689,11 +700,11 @@ msgstr "Hibás felhasználónév vagy jelszó"
msgctxt "#33010" msgctxt "#33010"
msgid "User is unauthorized for server {0}" msgid "User is unauthorized for server {0}"
msgstr "" msgstr "A felhasználó nem jogosult a {0} szerverhez való hozzáférésre"
msgctxt "#33011" msgctxt "#33011"
msgid "Plex.tv did not provide us a valid list of Plex users, sorry." msgid "Plex.tv did not provide us a valid list of Plex users, sorry."
msgstr "" msgstr "A Plex.tv sajnos nem adta meg a jogosult Plex felhasználók listáját"
# Dialog before playback # Dialog before playback
msgctxt "#33013" msgctxt "#33013"
@ -838,7 +849,7 @@ msgstr ""
# PKC Settings - Artwork # PKC Settings - Artwork
msgctxt "#39020" msgctxt "#39020"
msgid "Cache all images to Kodi texture cache now" msgid "Cache all images to Kodi texture cache now"
msgstr "" msgstr "Minden kép gyorsítótárazása a Kodi gyorsítótárába most"
# Appended to a listed PMS if it is in the same LAN network as PKC # Appended to a listed PMS if it is in the same LAN network as PKC
msgctxt "#39022" msgctxt "#39022"
@ -925,6 +936,7 @@ msgstr ""
msgctxt "#39036" msgctxt "#39036"
msgid "Escape special characters in path (e.g. space to %20)" msgid "Escape special characters in path (e.g. space to %20)"
msgstr "" msgstr ""
"A speciális karakterek feloldása az elérési útban (pl. szóköz helyett %20)"
# PKC Settings - Customize Paths # PKC Settings - Customize Paths
msgctxt "#39037" msgctxt "#39037"
@ -1002,7 +1014,7 @@ msgstr "Semmi sem működik? Próbálja meg a teljes visszaállítást!"
# PKC Settings - Connection # PKC Settings - Connection
msgctxt "#39050" msgctxt "#39050"
msgid "Choose Plex Server from a list" msgid "Choose Plex Server from a list"
msgstr "" msgstr "Válasszon Plex szervert a listából"
# PKC Settings - Sync # PKC Settings - Sync
msgctxt "#39051" msgctxt "#39051"
@ -1100,7 +1112,7 @@ msgstr "Az Ön jelenlegi Plex médiaszervere:"
# PKC Settings - Connection # PKC Settings - Connection
msgctxt "#39068" msgctxt "#39068"
msgid "Manually enter Plex Media Server address" msgid "Manually enter Plex Media Server address"
msgstr "" msgstr "Plex médiaszerver címének kézi megadása"
# PKC Settings - Connection # PKC Settings - Connection
msgctxt "#39069" msgctxt "#39069"
@ -1170,20 +1182,24 @@ msgid ""
"Use Add-on Paths (default, easy) or Direct Paths? Choose Add-on Paths if " "Use Add-on Paths (default, easy) or Direct Paths? Choose Add-on Paths if "
"you're unsure. PKC will not work if your Direct Paths setup is wrong!" "you're unsure. PKC will not work if your Direct Paths setup is wrong!"
msgstr "" msgstr ""
"Bővítmény elérési utakat (alapértelmezett, egyszerű) vagy közvetlen elérési "
"utakat kíván használni? Ha nem biztos benne, válassza a bővítmény elérési "
"utakat. A PKC nem fog működni, ha a közvetlen elérési utak rosszul vannak "
"beállítva!"
# Button text for choosing PKC mode # Button text for choosing PKC mode
msgctxt "#39081" msgctxt "#39081"
msgid "Add-on Paths" msgid "Add-on Paths"
msgstr "" msgstr "Bővítmény elérési utak"
# Button text for choosing PKC mode # Button text for choosing PKC mode
msgctxt "#39082" msgctxt "#39082"
msgid "Direct Paths" msgid "Direct Paths"
msgstr "" msgstr "Közvetlen elérési utak"
msgctxt "#39200" msgctxt "#39200"
msgid "Log-out Plex Home User " msgid "Log-out Plex Home User "
msgstr "Kijelentkezés az otthoni Plex felhasználó fiókból" msgstr "Kijelentkezés az otthoni Plex felhasználó fiókból: "
msgctxt "#39201" msgctxt "#39201"
msgid "Settings" msgid "Settings"
@ -1219,7 +1235,7 @@ msgstr "A PKC visszaállítása sikertelen. Kérem indítsa újra a Kodi-t."
# PKC Settings - Plex # PKC Settings - Plex
msgctxt "#39209" msgctxt "#39209"
msgid "Toggle plex.tv login (sign in or sign out)" msgid "Toggle plex.tv login (sign in or sign out)"
msgstr "" msgstr "Plex.tv bejelentkezés átkapcsolása (be- vagy kijelentkezés)"
msgctxt "#39210" msgctxt "#39210"
msgid "Not yet connected to Plex Server" msgid "Not yet connected to Plex Server"
@ -1265,7 +1281,7 @@ msgstr "plex.tv átkapcsolás sikeres"
msgctxt "#39222" msgctxt "#39222"
msgid "Look for missing fanart on FanartTV now" msgid "Look for missing fanart on FanartTV now"
msgstr "" msgstr "Hiányzó művészképek keresése a FanArtTV-n most"
msgctxt "#39223" msgctxt "#39223"
msgid "" msgid ""
@ -1303,7 +1319,7 @@ msgstr "Plex felhasználó:"
# appended at the end of the string # appended at the end of the string
msgctxt "#39229" msgctxt "#39229"
msgid "Login failed with plex.tv for user" msgid "Login failed with plex.tv for user"
msgstr "" msgstr "Sikertelen bejelentkezés a plex.tv-re a következő felhasználóval"
msgctxt "#39250" msgctxt "#39250"
msgid "" msgid ""
@ -1379,6 +1395,8 @@ msgid ""
"The current Kodi version is not supported by PKC. Please consult the Plex " "The current Kodi version is not supported by PKC. Please consult the Plex "
"forum." "forum."
msgstr "" msgstr ""
"A PKC nem támogatja a jelenlegi Kodi verziót. Kérjen tanácsot a Plex "
"fórumon."
msgctxt "#39405" msgctxt "#39405"
msgid "Plex playlists/nodes refreshed" msgid "Plex playlists/nodes refreshed"

View file

@ -1288,12 +1288,12 @@ msgstr "Alleen ontbrekende"
# Message in the PKC settings if user has not logged in to plex.tv # Message in the PKC settings if user has not logged in to plex.tv
msgctxt "#39226" msgctxt "#39226"
msgid "Not logged in to plex.tv" msgid "Not logged in to plex.tv"
msgstr "Niet ingelogd op plek.tv" msgstr "Niet ingelogd op plex.tv"
# Message in the PKC settings if user is logged in to plex.tv # Message in the PKC settings if user is logged in to plex.tv
msgctxt "#39227" msgctxt "#39227"
msgid "Logged in to plex.tv" msgid "Logged in to plex.tv"
msgstr "Ingelogd op plek.tv" msgstr "Ingelogd op plex.tv"
# Message in the PKC settings to display the plex.tv username. Leave the colon # Message in the PKC settings to display the plex.tv username. Leave the colon
# : # :

View file

@ -81,7 +81,7 @@ class MusicMixin(object):
self.remove_song(db_item['kodi_id'], db_item['kodi_pathid']) self.remove_song(db_item['kodi_id'], db_item['kodi_pathid'])
# Album verification # Album verification
if not self.plexdb.album_has_songs(db_item['album_id']): if not self.plexdb.album_has_songs(db_item['album_id']):
# No episode left for this season - so delete the season # No songleft for this album - so delete the album
self.remove_album(db_item['parent_id']) self.remove_album(db_item['parent_id'])
self.plexdb.remove(db_item['album_id'], v.PLEX_TYPE_ALBUM) self.plexdb.remove(db_item['album_id'], v.PLEX_TYPE_ALBUM)
# Artist verification # Artist verification
@ -91,8 +91,9 @@ class MusicMixin(object):
self.plexdb.remove(db_item['artist_id'], v.PLEX_TYPE_ARTIST) self.plexdb.remove(db_item['artist_id'], v.PLEX_TYPE_ARTIST)
# ALBUM ##### # ALBUM #####
elif db_item['plex_type'] == v.PLEX_TYPE_ALBUM: elif db_item['plex_type'] == v.PLEX_TYPE_ALBUM:
# Remove episodes, season, verify tvshow # Remove songs, album, verify artist
for song in self.plexdb.song_by_album(db_item['plex_id']): songs = list(self.plexdb.song_by_album(db_item['plex_id']))
for song in songs:
self.remove_song(song['kodi_id'], song['kodi_pathid']) self.remove_song(song['kodi_id'], song['kodi_pathid'])
self.plexdb.remove(song['plex_id'], v.PLEX_TYPE_SONG) self.plexdb.remove(song['plex_id'], v.PLEX_TYPE_SONG)
# Remove the album # Remove the album
@ -100,16 +101,18 @@ class MusicMixin(object):
# Show verification # Show verification
if (not self.plexdb.artist_has_albums(db_item['kodi_id']) and if (not self.plexdb.artist_has_albums(db_item['kodi_id']) and
not self.plexdb.artist_has_songs(db_item['kodi_id'])): not self.plexdb.artist_has_songs(db_item['kodi_id'])):
# There's no other season or episode left, delete the show # There's no other album or song left, delete the artist
self.remove_artist(db_item['parent_id']) self.remove_artist(db_item['parent_id'])
self.plexdb.remove(db_item['artist_id'], v.KODI_TYPE_ARTIST) self.plexdb.remove(db_item['artist_id'], v.KODI_TYPE_ARTIST)
# ARTIST ##### # ARTIST #####
elif db_item['plex_type'] == v.PLEX_TYPE_ARTIST: elif db_item['plex_type'] == v.PLEX_TYPE_ARTIST:
# Remove songs, albums and the artist himself # Remove songs, albums and the artist himself
for song in self.plexdb.song_by_artist(db_item['plex_id']): songs = list(self.plexdb.song_by_artist(db_item['plex_id']))
for song in songs:
self.remove_song(song['kodi_id'], song['kodi_pathid']) self.remove_song(song['kodi_id'], song['kodi_pathid'])
self.plexdb.remove(song['plex_id'], v.PLEX_TYPE_SONG) self.plexdb.remove(song['plex_id'], v.PLEX_TYPE_SONG)
for album in self.plexdb.album_by_artist(db_item['plex_id']): albums = list(self.plexdb.album_by_artist(db_item['plex_id']))
for album in albums:
self.remove_album(album['kodi_id']) self.remove_album(album['kodi_id'])
self.plexdb.remove(album['plex_id'], v.PLEX_TYPE_ALBUM) self.plexdb.remove(album['plex_id'], v.PLEX_TYPE_ALBUM)
self.remove_artist(db_item['kodi_id']) self.remove_artist(db_item['kodi_id'])

View file

@ -70,7 +70,8 @@ class TvShowMixin(object):
# SEASON ##### # SEASON #####
elif db_item['plex_type'] == v.PLEX_TYPE_SEASON: elif db_item['plex_type'] == v.PLEX_TYPE_SEASON:
# Remove episodes, season, verify tvshow # Remove episodes, season, verify tvshow
for episode in self.plexdb.episode_by_season(db_item['plex_id']): episodes = list(self.plexdb.episode_by_season(db_item['plex_id']))
for episode in episodes:
self.remove_episode(episode['kodi_id'], episode['kodi_fileid']) self.remove_episode(episode['kodi_id'], episode['kodi_fileid'])
self.plexdb.remove(episode['plex_id'], v.PLEX_TYPE_EPISODE) self.plexdb.remove(episode['plex_id'], v.PLEX_TYPE_EPISODE)
# Remove season # Remove season
@ -84,13 +85,15 @@ class TvShowMixin(object):
# TVSHOW ##### # TVSHOW #####
elif db_item['plex_type'] == v.PLEX_TYPE_SHOW: elif db_item['plex_type'] == v.PLEX_TYPE_SHOW:
# Remove episodes, seasons and the tvshow itself # Remove episodes, seasons and the tvshow itself
for episode in self.plexdb.episode_by_show(db_item['plex_id']): seasons = list(self.plexdb.season_by_show(db_item['plex_id']))
for season in seasons:
self.remove_season(season['kodi_id'])
self.plexdb.remove(season['plex_id'], v.PLEX_TYPE_SEASON)
episodes = list(self.plexdb.episode_by_show(db_item['plex_id']))
for episode in episodes:
self.remove_episode(episode['kodi_id'], self.remove_episode(episode['kodi_id'],
episode['kodi_fileid']) episode['kodi_fileid'])
self.plexdb.remove(episode['plex_id'], v.PLEX_TYPE_EPISODE) self.plexdb.remove(episode['plex_id'], v.PLEX_TYPE_EPISODE)
for season in self.plexdb.season_by_show(db_item['plex_id']):
self.remove_season(season['kodi_id'])
self.plexdb.remove(season['plex_id'], v.PLEX_TYPE_SEASON)
self.remove_show(db_item['kodi_id']) self.remove_show(db_item['kodi_id'])
LOG.debug('Deleted %s %s from all databases', LOG.debug('Deleted %s %s from all databases',

View file

@ -415,6 +415,12 @@ class FullSync(common.fullsync_mixin):
self.dialog.close() self.dialog.close()
if self.threader: if self.threader:
self.threader.shutdown() self.threader.shutdown()
if not self.successful and not self.isCanceled():
# "ERROR in library sync"
utils.dialog('notification',
heading='{plex}',
message=utils.lang(39410),
icon='{error}')
if self.callback: if self.callback:
self.callback(self.successful) self.callback(self.successful)
LOG.info('Done full_sync') LOG.info('Done full_sync')

View file

@ -13,12 +13,17 @@ from .. import plex_functions as PF, music, utils, variables as v, app
LOG = getLogger('PLEX.sync.sections') LOG = getLogger('PLEX.sync.sections')
BATCH_SIZE = 200
VNODES = videonodes.VideoNodes() VNODES = videonodes.VideoNodes()
PLAYLISTS = {} PLAYLISTS = {}
NODES = {} NODES = {}
SECTIONS = [] SECTIONS = []
def isCanceled():
return app.APP.stop_pkc or app.APP.suspend_threads or app.SYNC.stop_sync
def sync_from_pms(): def sync_from_pms():
""" """
Sync the Plex library sections Sync the Plex library sections
@ -198,56 +203,61 @@ def _process_section(section_xml, kodidb, plexdb, sorted_sections,
return totalnodes return totalnodes
def _delete_kodi_db_items(section_id, section_type):
if section_type == v.PLEX_TYPE_MOVIE:
kodi_context = kodi_db.KodiVideoDB
types = ((v.PLEX_TYPE_MOVIE, itemtypes.Movie), )
elif section_type == v.PLEX_TYPE_SHOW:
kodi_context = kodi_db.KodiVideoDB
types = ((v.PLEX_TYPE_SHOW, itemtypes.Show),
(v.PLEX_TYPE_SEASON, itemtypes.Season),
(v.PLEX_TYPE_EPISODE, itemtypes.Episode))
elif section_type == v.PLEX_TYPE_ARTIST:
kodi_context = kodi_db.KodiMusicDB
types = ((v.PLEX_TYPE_ARTIST, itemtypes.Artist),
(v.PLEX_TYPE_ALBUM, itemtypes.Album),
(v.PLEX_TYPE_SONG, itemtypes.Song))
for plex_type, context in types:
while True:
with PlexDB() as plexdb:
plex_ids = list(plexdb.plexid_by_sectionid(section_id,
plex_type,
BATCH_SIZE))
with kodi_context(texture_db=True) as kodidb:
typus = context(None, plexdb=plexdb, kodidb=kodidb)
for plex_id in plex_ids:
if isCanceled():
return False
typus.remove(plex_id)
if len(plex_ids) < BATCH_SIZE:
break
return True
def delete_sections(old_sections): def delete_sections(old_sections):
""" """
Deletes all elements for a Plex section that has been deleted. (e.g. all Deletes all elements for a Plex section that has been deleted. (e.g. all
TV shows, Seasons and Episodes of a Show section) TV shows, Seasons and Episodes of a Show section)
""" """
utils.dialog('notification', try:
heading='{plex}', with PlexDB() as plexdb:
message=utils.lang(30052), old_sections = [plexdb.section(x) for x in old_sections]
icon='{plex}',
sound=False)
video_library_update = False
music_library_update = False
with PlexDB() as plexdb:
old_sections = [plexdb.section(x) for x in old_sections]
LOG.info("Removing entire Plex library sections: %s", old_sections) LOG.info("Removing entire Plex library sections: %s", old_sections)
with kodi_db.KodiVideoDB(texture_db=True) as kodidb: for section in old_sections:
for section in old_sections: # "Deleting <section_name>"
if section[2] == v.KODI_TYPE_PHOTO: utils.dialog('notification',
# not synced heading='{plex}',
plexdb.remove_section(section[0]) message='%s %s' % (utils.lang(30052), section[1]),
continue icon='{plex}',
elif section[2] == v.KODI_TYPE_MOVIE: sound=False)
video_library_update = True if section[2] == v.PLEX_TYPE_PHOTO:
context = itemtypes.Movie(None, # not synced - just remove the link in our Plex sections table
plexdb=plexdb, pass
kodidb=kodidb) else:
elif section[2] == v.KODI_TYPE_SHOW: if not _delete_kodi_db_items(section[0], section[2]):
video_library_update = True return
context = itemtypes.Show(None, # Only remove Plex entry if we've removed all items first
plexdb=plexdb, with PlexDB() as plexdb:
kodidb=kodidb)
else:
continue
for plex_id in plexdb.plexid_by_sectionid(section[0], section[2]):
context.remove(plex_id)
# Only remove Plex entry if we've removed all items first
plexdb.remove_section(section[0]) plexdb.remove_section(section[0])
finally:
with kodi_db.KodiMusicDB(texture_db=True) as kodidb: common.update_kodi_library()
for section in old_sections:
if section[2] == v.KODI_TYPE_ARTIST:
music_library_update = True
context = itemtypes.Artist(None,
plexdb=plexdb,
kodidb=kodidb)
else:
continue
for plex_id in plexdb.plexid_by_sectionid(section[0], section[2]):
context.remove(plex_id)
# Only remove Plex entry if we've removed all items first
plexdb.remove_section(section[0])
common.update_kodi_library(video=video_library_update,
music=music_library_update)

View file

@ -1744,7 +1744,13 @@ class API(object):
if path.startswith('\\\\'): if path.startswith('\\\\'):
path = 'smb:' + path.replace('\\', '/') path = 'smb:' + path.replace('\\', '/')
if app.SYNC.escape_path: if app.SYNC.escape_path:
path = quote(path) try:
protocol, hostname, args = path.split(':', 2)
except ValueError:
pass
else:
args = quote(args)
path = '%s:%s:%s' % (protocol, hostname, args)
if (app.SYNC.path_verified and not force_check) or omit_check: if (app.SYNC.path_verified and not force_check) or omit_check:
return path return path

View file

@ -162,10 +162,11 @@ class PlexDBBase(object):
self.cursor.execute('UPDATE %s SET fanart_synced = 1 WHERE plex_id = ?' % plex_type, self.cursor.execute('UPDATE %s SET fanart_synced = 1 WHERE plex_id = ?' % plex_type,
(plex_id, )) (plex_id, ))
def plexid_by_sectionid(self, section_id, plex_type): def plexid_by_sectionid(self, section_id, plex_type, limit):
return (x[0] for x in query = '''
self.cursor.execute('SELECT plex_id FROM %s WHERE section_id = ?' % plex_type, SELECT plex_id FROM %s WHERE section_id = ? LIMIT %s
(section_id, ))) ''' % (plex_type, limit)
return (x[0] for x in self.cursor.execute(query, (section_id, )))
def kodiid_by_sectionid(self, section_id, plex_type): def kodiid_by_sectionid(self, section_id, plex_type):
return (x[0] for x in return (x[0] for x in

View file

@ -43,31 +43,6 @@ class Sync(backgroundthread.KillableThread):
def isSuspended(self): def isSuspended(self):
return self._suspended or app.APP.suspend_threads return self._suspended or app.APP.suspend_threads
def show_kodi_note(self, message, icon="plex", force=False):
"""
Shows a Kodi popup, if user selected to do so. Pass message in unicode
or string
icon: "plex": shows Plex icon
"error": shows Kodi error icon
"""
if app.APP.player.isPlaying():
LOG.info('Playing media - not showing note: %s', message)
return
if not force and app.SYNC.sync_dialog is not True and self.force_dialog is not True:
return
if icon == "plex":
utils.dialog('notification',
heading='{plex}',
message=message,
icon='{plex}',
sound=False)
elif icon == "error":
utils.dialog('notification',
heading='{plex}',
message=message,
icon='{error}')
def triage_lib_scans(self): def triage_lib_scans(self):
""" """
Decides what to do if app.SYNC.run_lib_scan has been set. E.g. manually Decides what to do if app.SYNC.run_lib_scan has been set. E.g. manually
@ -81,7 +56,7 @@ class Sync(backgroundthread.KillableThread):
block=True) block=True)
if not self.sync_successful and not self.isSuspended() and not self.isCanceled(): if not self.sync_successful and not self.isSuspended() and not self.isCanceled():
# ERROR in library sync # ERROR in library sync
self.show_kodi_note(utils.lang(39410), icon='error') LOG.warn('Triggered full/repair sync has not been successful')
elif app.SYNC.run_lib_scan == 'fanart': elif app.SYNC.run_lib_scan == 'fanart':
# Only look for missing fanart (No) or refresh all fanart (Yes) # Only look for missing fanart (No) or refresh all fanart (Yes)
from .windows import optionsdialog from .windows import optionsdialog
@ -113,10 +88,7 @@ class Sync(backgroundthread.KillableThread):
self.last_full_sync = timing.unix_timestamp() self.last_full_sync = timing.unix_timestamp()
set_library_scan_toggle(boolean=False) set_library_scan_toggle(boolean=False)
if not successful: if not successful:
LOG.error('Could not finish scheduled full sync') LOG.warn('Could not finish scheduled full sync')
self.force_dialog = True
self.show_kodi_note(utils.lang(39410), icon='error')
self.force_dialog = False
# try: # try:
# self.lock.release() # self.lock.release()
# except backgroundthread.threading.ThreadError: # except backgroundthread.threading.ThreadError:

View file

@ -91,7 +91,7 @@ COMPANION_PORT = int(_ADDON.getSetting('companionPort'))
PKC_MACHINE_IDENTIFIER = None PKC_MACHINE_IDENTIFIER = None
# Minimal PKC version needed for the Kodi database - otherwise need to recreate # Minimal PKC version needed for the Kodi database - otherwise need to recreate
MIN_DB_VERSION = '2.5.12' MIN_DB_VERSION = '2.6.1'
# Supported databases # Supported databases
SUPPORTED_VIDEO_DB = { SUPPORTED_VIDEO_DB = {