includio-cms 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,6 +3,7 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { writeFile } from 'node:fs/promises';
|
|
4
4
|
import sharp from 'sharp';
|
|
5
5
|
import ffmpeg from 'fluent-ffmpeg';
|
|
6
|
+
const fullDir = process.env.NODE_ENV === 'production' ? `/data/uploads` : `./static/uploads`;
|
|
6
7
|
// Funkcja pomocnicza do przetwarzania wideo
|
|
7
8
|
async function processVideo(filepath, filename) {
|
|
8
9
|
return new Promise((resolve) => {
|
|
@@ -45,13 +46,12 @@ async function processVideo(filepath, filename) {
|
|
|
45
46
|
.screenshots({
|
|
46
47
|
timestamps: ['00:00:01'], // Pobieramy klatkę z 1. sekundy
|
|
47
48
|
filename: thumbnailFilename,
|
|
48
|
-
folder:
|
|
49
|
+
folder: fullDir,
|
|
49
50
|
size: '320x240' // Rozmiar thumbnaiła
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
export function local() {
|
|
54
|
-
const fullDir = `/data/uploads`;
|
|
55
55
|
return {
|
|
56
56
|
// getFiles: async (): Promise<MediaFile[]> => {
|
|
57
57
|
// const files = await readdir(dir);
|