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

chore(server): save original file name with extension #7679

Merged
merged 15 commits into from Mar 7, 2024

Conversation

alextran1502
Copy link
Contributor

No description provided.

Copy link

cloudflare-pages bot commented Mar 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 07d3136
Status: ✅  Deploy successful!
Preview URL: https://ed7d2197.immich.pages.dev
Branch Preview URL: https://server-save-original-filenam.immich.pages.dev

View logs

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still WIP? I don't see changes to the web or mobile to not append the extension anymore. I also don't see a migration.

server/src/immich/api-v1/asset/asset.service.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,20 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddExtensionToOriginalFileName1709763765506 implements MigrationInterface {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrasm91 Migration is added

@mertalev Does the query look ok here to append the file extension to the original name?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks fine. Only potential concern is that it doesn't handle filenames with no extension, but I think we reject any files without extensions anyway.

Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
@alextran1502 alextran1502 enabled auto-merge (squash) March 7, 2024 02:33
@alextran1502 alextran1502 merged commit 3da2b05 into main Mar 7, 2024
25 checks passed
@alextran1502 alextran1502 deleted the server/save-original-filename-with-extension branch March 7, 2024 02:34
@jrasm91
Copy link
Contributor

jrasm91 commented Mar 7, 2024

Can you fix this?

export function getAssetFilename(asset: AssetResponseDto): string {

aviv926 pushed a commit to aviv926/immich that referenced this pull request Mar 7, 2024
* chore(server): save original file name with extension

* extract extension

* update e2e test

* update e2e test

* download archive

* fix download archive appending name

* pr feedback

* remove unused code

* test

* unit test

* remove unused code

* migration

* noops

* pr feedback

* Update server/src/domain/download/download.service.ts

Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>

---------

Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants