Fix AttributeError

This commit is contained in:
croneter 2018-11-26 17:32:21 +01:00
parent a0e14ca2cb
commit 4515559dff
2 changed files with 7 additions and 3 deletions

View file

@ -175,10 +175,9 @@ def _process_section(section_xml, kodidb, plexdb, sorted_sections,
nodes.append(section_name)
totalnodes += 1
# Update items with new tag
for item in plexdb.kodi_id_by_section(section_id):
# Remove the "s" from viewtype for tags
for kodi_id in plexdb.kodiid_by_sectionid(section_id, plex_type):
kodidb.update_tag(
current_tagid, tagid, item[0], current_sectiontype[:-1])
current_tagid, tagid, kodi_id, current_sectiontype)
else:
# Validate the playlist exists or recreate it
if (section_name not in playlists and plex_type in

View file

@ -148,6 +148,11 @@ class PlexDBBase(object):
self.cursor.execute('SELECT plex_id FROM %s WHERE section_id = ?' % plex_type,
(section_id, )))
def kodiid_by_sectionid(self, section_id, plex_type):
return (x[0] for x in
self.cursor.execute('SELECT kodi_id FROM %s WHERE section_id = ?' % plex_type,
(section_id, )))
def initialize():
"""