@@ -113,7 +113,8 @@ public function getVideoUrl(string|Asset $filePath, array $videoOptions, bool $g
113113 $ filePath = $ this ->getAssetPath ($ filePath );
114114
115115 if (!empty ($ filePath )) {
116- $ destVideoPath = $ settings ['transcoderPaths ' ]['video ' ] . $ subfolder ?? $ settings ['transcoderPaths ' ]['default ' ];
116+ $ destVideoPath = $ settings ['transcoderPaths ' ]['video ' ] ?? $ settings ['transcoderPaths ' ]['default ' ];
117+ $ destVideoPath .= $ subfolder ;
117118 $ destVideoPath = App::parseEnv ($ destVideoPath );
118119 $ videoOptions = $ this ->coalesceOptions ('defaultVideoOptions ' , $ videoOptions );
119120
@@ -207,7 +208,8 @@ public function getVideoUrl(string|Asset $filePath, array $videoOptions, bool $g
207208
208209 // If the video file already exists and hasn't been modified, return it. Otherwise, start it transcoding
209210 if (file_exists ($ destVideoPath ) && (@filemtime ($ destVideoPath ) >= @filemtime ($ filePath ))) {
210- $ url = $ settings ['transcoderUrls ' ]['video ' ] . $ subfolder ?? $ settings ['transcoderUrls ' ]['default ' ];
211+ $ url = $ settings ['transcoderUrls ' ]['video ' ] ?? $ settings ['transcoderUrls ' ]['default ' ];
212+ $ url .= $ subfolder ;
211213 $ result = App::parseEnv ($ url ) . $ destVideoFile ;
212214 // skip encoding
213215 } elseif (!$ generate ) {
@@ -251,7 +253,8 @@ public function getVideoThumbnailUrl(Asset|string $filePath, array $thumbnailOpt
251253 $ filePath = $ this ->getAssetPath ($ filePath );
252254
253255 if (!empty ($ filePath )) {
254- $ destThumbnailPath = $ settings ['transcoderPaths ' ]['thumbnail ' ] . $ subfolder ?? $ settings ['transcoderPaths ' ]['default ' ];
256+ $ destThumbnailPath = $ settings ['transcoderPaths ' ]['thumbnail ' ] ?? $ settings ['transcoderPaths ' ]['default ' ];
257+ $ destThumbnailPath .= $ subfolder ;
255258 $ destThumbnailPath = App::parseEnv ($ destThumbnailPath );
256259
257260 $ thumbnailOptions = $ this ->coalesceOptions ('defaultThumbnailOptions ' , $ thumbnailOptions );
@@ -309,7 +312,8 @@ public function getVideoThumbnailUrl(Asset|string $filePath, array $thumbnailOpt
309312 if ($ asPath ) {
310313 $ result = $ destThumbnailPath ;
311314 } else {
312- $ url = $ settings ['transcoderUrls ' ]['thumbnail ' ] . $ subfolder ?? $ settings ['transcoderUrls ' ]['default ' ];
315+ $ url = $ settings ['transcoderUrls ' ]['thumbnail ' ] ?? $ settings ['transcoderUrls ' ]['default ' ];
316+ $ url .= $ subfolder ;
313317 $ result = App::parseEnv ($ url ) . $ destThumbnailFile ;
314318 }
315319 }
@@ -341,7 +345,8 @@ public function getAudioUrl(Asset|string $filePath, array $audioOptions): string
341345 $ filePath = $ this ->getAssetPath ($ filePath );
342346
343347 if (!empty ($ filePath )) {
344- $ destAudioPath = $ settings ['transcoderPaths ' ]['audio ' ] . $ subfolder ?? $ settings ['transcoderPaths ' ]['default ' ];
348+ $ destAudioPath = $ settings ['transcoderPaths ' ]['audio ' ] ?? $ settings ['transcoderPaths ' ]['default ' ];
349+ $ destAudioPath .= $ subfolder ;
345350 $ destAudioPath = App::parseEnv ($ destAudioPath );
346351
347352 $ audioOptions = $ this ->coalesceOptions ('defaultAudioOptions ' , $ audioOptions );
@@ -436,15 +441,17 @@ public function getAudioUrl(Asset|string $filePath, array $audioOptions): string
436441
437442 // If the audio file already exists and hasn't been modified, return it. Otherwise, start it transcoding
438443 if (file_exists ($ destAudioPath ) && (@filemtime ($ destAudioPath ) >= @filemtime ($ filePath ))) {
439- $ url = $ settings ['transcoderUrls ' ]['audio ' ] . $ subfolder ?? $ settings ['transcoderUrls ' ]['default ' ];
444+ $ url = $ settings ['transcoderUrls ' ]['audio ' ] ?? $ settings ['transcoderUrls ' ]['default ' ];
445+ $ url .= $ subfolder ;
440446 $ result = App::parseEnv ($ url ) . $ destAudioFile ;
441447 } else {
442448 // Kick off the transcoding
443449 $ pid = $ this ->executeShellCommand ($ ffmpegCmd );
444450
445451 if ($ synchronous ) {
446452 Craft::info ($ ffmpegCmd , __METHOD__ );
447- $ url = $ settings ['transcoderUrls ' ]['audio ' ] . $ subfolder ?? $ settings ['transcoderUrls ' ]['default ' ];
453+ $ url = $ settings ['transcoderUrls ' ]['audio ' ] ?? $ settings ['transcoderUrls ' ]['default ' ];
454+ $ url .= $ subfolder ;
448455 $ result = App::parseEnv ($ url ) . $ destAudioFile ;
449456 } else {
450457 Craft::info ($ ffmpegCmd . "\nffmpeg PID: " . $ pid , __METHOD__ );
@@ -646,7 +653,8 @@ public function getGifUrl(Asset|string $filePath, array $gifOptions): string|fal
646653
647654 if (!empty ($ filePath )) {
648655 // Dest path
649- $ destVideoPath = $ settings ['transcoderPaths ' ]['gif ' ] . $ subfolder ?? $ settings ['transcoderPaths ' ]['default ' ];
656+ $ destVideoPath = $ settings ['transcoderPaths ' ]['gif ' ] ?? $ settings ['transcoderPaths ' ]['default ' ];
657+ $ destVideoPath .= $ subfolder ;
650658 $ destVideoPath = App::parseEnv ($ destVideoPath );
651659
652660 // Options
@@ -702,7 +710,8 @@ public function getGifUrl(Asset|string $filePath, array $gifOptions): string|fal
702710
703711 // If the video file already exists and hasn't been modified, return it. Otherwise, start it transcoding
704712 if (file_exists ($ destVideoPath ) && (@filemtime ($ destVideoPath ) >= @filemtime ($ filePath ))) {
705- $ url = $ settings ['transcoderUrls ' ]['gif ' ] . $ subfolder ?? $ settings ['transcoderUrls ' ]['default ' ];
713+ $ url = $ settings ['transcoderUrls ' ]['gif ' ] ?? $ settings ['transcoderUrls ' ]['default ' ];
714+ $ url .= $ subfolder ;
706715 $ result = App::parseEnv ($ url ) . $ destVideoFile ;
707716 } else {
708717 // Kick off the transcoding
0 commit comments