MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / prepareMediaPaths

Method prepareMediaPaths

rev/rev.ts:237–255  ·  view source on GitHub ↗
(media: any)

Source from the content-addressed store, hash-verified

235 this.cleanupFiles([inputPath, outputPath]);
236 }
237 }
238
239 private prepareMediaPaths(media: any) {
240 const extension = this.getExtensionFromMedia(media);
241 const uniqueId = `${Date.now().toString(36)}_${Math.random()
242 .toString(36)
243 .slice(2, 8)}`;
244 const inputPath = path.join(
245 FAN_TEMP_DIR,
246 `fan_src_${uniqueId}${extension}`
247 );
248 const outputPath = path.join(
249 FAN_TEMP_DIR,
250 `fan_flip_${uniqueId}${extension}`
251 );
252 const isGif = this.isGifMedia(media);
253 const isWebm = this.isWebmMedia(media);
254 const isWebp = extension === '.webp';
255
256 return { inputPath, outputPath, isGif, isWebm, isWebp };
257 }
258

Callers 1

Calls 3

getExtensionFromMediaMethod · 0.95
isGifMediaMethod · 0.95
isWebmMediaMethod · 0.95

Tested by

no test coverage detected