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:
state.PATH_VERIFIED = False
try:
iterator = PF.SectionItems(
section['id'],
{'type': v.PLEX_TYPE_NUMBER_FROM_PLEX_TYPE[self.plex_type]})
iterator = PF.SectionItems(section['id'],
{'type': self.plex_type})
# Tell the processing thread about this new section
queue_info = process_metadata.InitNewSection(
self.context,

View file

@ -47,9 +47,7 @@ def sync_pms_time():
continue
library_id = section.attrib['key']
try:
iterator = PF.SectionItems(
library_id,
{'type': v.PLEX_TYPE_NUMBER_FROM_PLEX_TYPE[plex_type]})
iterator = PF.SectionItems(library_id, {'type': plex_type})
for item in iterator:
if item.get('viewCount'):
# 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
"""
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__(
'{server}/library/sections/%s/all' % section_id, args)