Add Plex type to sync progress bar

This commit is contained in:
croneter 2018-11-09 15:05:17 +01:00
parent 4fca9b56c4
commit da7d871af8
2 changed files with 15 additions and 2 deletions

View file

@ -8,7 +8,7 @@ from pstats import Stats
from StringIO import StringIO
from . import common
from .. import backgroundthread, utils
from .. import backgroundthread, utils, variables as v
LOG = getLogger('PLEX.sync.process_metadata')
@ -66,7 +66,7 @@ class ProcessMetadata(backgroundthread.KillableThread, common.libsync_mixin):
except ZeroDivisionError:
progress = 0
self.dialog.update(progress,
self.section_name,
'%s: %s' % (self.section_type_text, self.section_name),
'%s/%s: %s'
% (self.current, self.total, self.title))
@ -93,6 +93,8 @@ class ProcessMetadata(backgroundthread.KillableThread, common.libsync_mixin):
self.processed = 0
self.total = section.total
self.section_name = section.name
self.section_type_text = utils.lang(
v.TRANSLATION_FROM_PLEXTYPE[section.plex_type])
profile = Profile()
profile.enable()
with section.context(self.last_sync) as context:

View file

@ -332,6 +332,17 @@ REMAP_TYPE_FROM_PLEXTYPE = {
}
TRANSLATION_FROM_PLEXTYPE = {
PLEX_TYPE_MOVIE: 342,
PLEX_TYPE_EPISODE: 20360,
PLEX_TYPE_SEASON: 20373,
PLEX_TYPE_SHOW: 20343,
PLEX_TYPE_SONG: 134,
PLEX_TYPE_ARTIST: 133,
PLEX_TYPE_ALBUM: 132,
PLEX_TYPE_PHOTO: 1,
}
REMAP_TYPE_FROM_PLEXTYPE = {
'movie': 'movie',
'show': 'tv',