Simplify call of SectionItems download

This commit is contained in:
croneter 2018-10-25 13:05:26 +02:00
parent 91533aa89f
commit a060b1fcaa
3 changed files with 5 additions and 6 deletions

View file

@ -119,9 +119,8 @@ class FullSync(backgroundthread.KillableThread, common.libsync_mixin):
if not self.install_sync_done: if not self.install_sync_done:
state.PATH_VERIFIED = False state.PATH_VERIFIED = False
try: try:
iterator = PF.SectionItems( iterator = PF.SectionItems(section['id'],
section['id'], {'type': self.plex_type})
{'type': v.PLEX_TYPE_NUMBER_FROM_PLEX_TYPE[self.plex_type]})
# Tell the processing thread about this new section # Tell the processing thread about this new section
queue_info = process_metadata.InitNewSection( queue_info = process_metadata.InitNewSection(
self.context, self.context,

View file

@ -47,9 +47,7 @@ def sync_pms_time():
continue continue
library_id = section.attrib['key'] library_id = section.attrib['key']
try: try:
iterator = PF.SectionItems( iterator = PF.SectionItems(library_id, {'type': plex_type})
library_id,
{'type': v.PLEX_TYPE_NUMBER_FROM_PLEX_TYPE[plex_type]})
for item in iterator: for item in iterator:
if item.get('viewCount'): if item.get('viewCount'):
# Don't want to mess with items that have playcount>0 # Don't want to mess with items that have playcount>0

View file

@ -589,6 +589,8 @@ class SectionItems(DownloadGen):
Iterator object to get all items of a Plex library section Iterator object to get all items of a Plex library section
""" """
def __init__(self, section_id, args=None): def __init__(self, section_id, args=None):
if args and 'type' in args:
args['type'] = v.PLEX_TYPE_NUMBER_FROM_PLEX_TYPE[args['type']]
super(SectionItems, self).__init__( super(SectionItems, self).__init__(
'{server}/library/sections/%s/all' % section_id, args) '{server}/library/sections/%s/all' % section_id, args)