Проверка количества каналов в плейлисте перед проверкой

This commit is contained in:
2025-05-06 22:54:18 +08:00
parent 6c9b7015a6
commit ea11381d07

View File

@@ -143,6 +143,11 @@ func CheckChannels(pls playlist.Playlist) playlist.Playlist {
} }
count := len(pls.Channels) count := len(pls.Channels)
if count == 0 {
log.Println("There are no channels to check, skipping")
return pls
}
timeout, routines := calcParameters(count) timeout, routines := calcParameters(count)
httpClient := http.Client{Timeout: timeout} httpClient := http.Client{Timeout: timeout}
chSemaphores := make(chan struct{}, routines) chSemaphores := make(chan struct{}, routines)