SECTION_COUNT = 0 for location in section.locations: plex_library_paths[section.key][SECTION_COUNT] = location SECTION_COUNT += 1 arr_plex_match = dict() arr_find_plex_id(arrpaths, arr_plex_match, plex_library_paths, plex_sections, config) # Check for duplicate entries in Plex. DUPLICATE = check_duplicate(server, plex_sections, config, delay) # Reload Plex data if duplicate items were found in Plex. if DUPLICATE > 0: plexlibrary = dict() server.reload() load_plex_data(server, plex_sections, plexlibrary, config) # Check for mismatched entries and correct them. PLEX_FIXED_MATCHES = 0 PLEX_FIXED_MATCHES += plex_compare_media(arr_plex_match, sonarr_items, radarr_items, plexlibrary, config, delay) print( f"{timeoutput()} - Number of fixed matches in Plex: {PLEX_FIXED_MATCHES}" ) if emby_enabled: # Load data from Emby. emby_library_paths = EmbyDB.libraries(config)