-function computeResolutionsToTranscode (videoFileHeight: number) {
- const resolutionsEnabled: number[] = []
- const configResolutions = CONFIG.TRANSCODING.RESOLUTIONS
-
- const resolutions = [
- VideoResolution.H_240P,
- VideoResolution.H_360P,
- VideoResolution.H_480P,
- VideoResolution.H_720P,
- VideoResolution.H_1080P
- ]
-
- for (const resolution of resolutions) {
- if (configResolutions[resolution.toString()] === true && videoFileHeight > resolution) {
- resolutionsEnabled.push(resolution)
- }
+async function getServerCommit () {
+ try {
+ const tag = await execPromise2(
+ '[ ! -d .git ] || git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || true',
+ { stdio: [ 0, 1, 2 ] }
+ )
+
+ if (tag) return tag.replace(/^v/, '')
+ } catch (err) {
+ logger.debug('Cannot get version from git tags.', { err })