Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): use correct file extension for motion photo videos #8659

Merged
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions server/src/migrations/1715435221124-MotionAssetExtensionMP4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class MotionAssetExtensionMP41715435221124 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`UPDATE "assets" SET "originalFileName" = regexp_replace("originalFileName", '\\.[a-zA-Z0-9]+$', '.mp4') WHERE "originalPath" LIKE '%.mp4' AND "isVisible" = false`,
);
}

public async down(): Promise<void> {
// TODO
lukashass marked this conversation as resolved.
Show resolved Hide resolved
}
}
2 changes: 1 addition & 1 deletion server/src/services/metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export class MetadataService {
checksum,
ownerId: asset.ownerId,
originalPath: motionPath,
originalFileName: asset.originalFileName,
originalFileName: `${path.parse(asset.originalFileName).name}.mp4`,
lukashass marked this conversation as resolved.
Show resolved Hide resolved
isVisible: false,
deviceAssetId: 'NONE',
deviceId: 'NONE',
Expand Down