Fix YouTube coordinator bug (#95492)

Fix coordinator bug
This commit is contained in:
Joost Lekkerkerker
2023-06-29 03:43:42 +02:00
committed by GitHub
parent 33c7cdcdb3
commit b86b41ebe5

View File

@@ -65,7 +65,7 @@ class YouTubeDataUpdateCoordinator(DataUpdateCoordinator):
channels = self.config_entry.options[CONF_CHANNELS] channels = self.config_entry.options[CONF_CHANNELS]
while received_channels < len(channels): while received_channels < len(channels):
# We're slicing the channels in chunks of 50 to avoid making the URI too long # We're slicing the channels in chunks of 50 to avoid making the URI too long
end = min(received_channels + 50, len(channels) - 1) end = min(received_channels + 50, len(channels))
channel_request: HttpRequest = service.channels().list( channel_request: HttpRequest = service.channels().list(
part="snippet,statistics", part="snippet,statistics",
id=",".join(channels[received_channels:end]), id=",".join(channels[received_channels:end]),