* Resize channel thumbnail image * @param {string} channelId - Channel ID * @returns {Promise }
(channelId)
| 514 | * @returns {Promise<void>} |
| 515 | */ |
| 516 | async resizeChannelThumbnail(channelId) { |
| 517 | const imagePath = configModule.getImagePath(); |
| 518 | const realImagePath = path.join( |
| 519 | imagePath, |
| 520 | `channelthumb-${channelId}.jpg` |
| 521 | ); |
| 522 | const smallImagePath = path.join( |
| 523 | imagePath, |
| 524 | `channelthumb-${channelId}-small.jpg` |
| 525 | ); |
| 526 | |
| 527 | try { |
| 528 | execSync( |
| 529 | `${configModule.ffmpegPath} -loglevel error -y -i "${realImagePath}" -vf "scale=iw*0.4:ih*0.4" -q:v 2 "${smallImagePath}"`, |
| 530 | { stdio: 'inherit' } |
| 531 | ); |
| 532 | await fsPromises.rename(smallImagePath, realImagePath); |
| 533 | logger.debug({ channelId }, 'Channel thumbnail resized successfully'); |
| 534 | } catch (err) { |
| 535 | logger.error({ err, channelId, imagePath: realImagePath }, 'Error resizing channel thumbnail'); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | /** |
| 540 | * Populate missing channel information for all enabled channels. |
no test coverage detected