mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
67c1633155
Two preparations the provider conversion needs, and neither changes behaviour. The ServiceResult envelope, the provider-agnostic asset shapes and pipeAsset move to nest/memories/memories.helpers.ts, which touches no database. The controllers and the provider services can name them without importing each other - the same reason notifications/notification-events.ts exists. What is left in services/memories/helpersService.ts is the DB-backed half (the access checks, the album-link lookups) and it folds with the providers. pipeAsset stays a free function over the Express response on purpose. It is not a StreamableFile candidate: it forwards the upstream's 206 and Content-Range so a <video> can seek (#823), swaps Cache-Control to no-store on an error status, and has to answer differently once headers are already sent. All three controllers take @Res() anyway. The three copies of `path.join(__dirname, '../../../uploads')` become one UPLOADS_ROOT. __dirname moves with the file and none of these would have thrown on a wrong depth - mkdirSync and multer create the wrong tree without a word, and every stored photo lands somewhere nobody serves from. UPLOADS-ROOT-001 pins it. The depth happens to be identical for nest/memories, so nothing moves today; the point is that the next move only has one place to get wrong.