Rev 10 | Rev 12 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10 | Rev 11 | ||
---|---|---|---|
Line 346... | Line 346... | ||
346 | $out = json_decode($cont, true); |
346 | $out = json_decode($cont, true); |
347 | if ($out == NULL) $out = array(); |
347 | if ($out == NULL) $out = array(); |
348 | 348 | ||
349 | if (!empty(_getResultcache())) { |
349 | if (!empty(_getResultcache())) { |
350 | $stats = yt_get_channel_stats($channel_id); |
350 | $stats = yt_get_channel_stats($channel_id); |
- | 351 | if ($stats === false) { |
|
- | 352 | fwrite(STDERR, "Cannot get stats for channel with ID '$channel_id'\n"); |
|
- | 353 | return; |
|
- | 354 | } |
|
351 | $videocount = $stats['videoCount']; |
355 | $videocount = $stats['videoCount']; |
352 | 356 | ||
353 | $key = (!empty($search)) ? 'cid:'.$channel_id.'/'.$search : 'cid:'.$channel_id; |
357 | $key = (!empty($search)) ? 'cid:'.$channel_id.'/'.$search : 'cid:'.$channel_id; |
354 | 358 | ||
355 | if (!isset($out[$key])) $out[$key] = array(); |
359 | if (!isset($out[$key])) $out[$key] = array(); |
Line 404... | Line 408... | ||
404 | $out = json_decode($cont, true); |
408 | $out = json_decode($cont, true); |
405 | if ($out == NULL) $out = array(); |
409 | if ($out == NULL) $out = array(); |
406 | 410 | ||
407 | if (!empty(_getResultcache())) { |
411 | if (!empty(_getResultcache())) { |
408 | $stats = yt_get_playlist_stats($playlist_id); |
412 | $stats = yt_get_playlist_stats($playlist_id); |
- | 413 | if ($stats === false) { |
|
- | 414 | fwrite(STDERR, "Cannot get stats for playlist with ID '$channel_id'\n"); |
|
- | 415 | return; |
|
- | 416 | } |
|
409 | $videocount = $stats['itemCount']; |
417 | $videocount = $stats['itemCount']; |
410 | 418 | ||
411 | $key = 'pid:'.$playlist_id; |
419 | $key = 'pid:'.$playlist_id; |
412 | 420 | ||
413 | if (!isset($out[$key])) $out[$key] = array(); |
421 | if (!isset($out[$key])) $out[$key] = array(); |