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

External Library Management faulty validation #8319

Closed
2 of 3 tasks
JW-CH opened this issue Mar 28, 2024 · 0 comments
Closed
2 of 3 tasks

External Library Management faulty validation #8319

JW-CH opened this issue Mar 28, 2024 · 0 comments
Labels
bug Something isn't working external-library Issues related to external libraries good first issue Good for newcomers 🗄️server

Comments

@JW-CH
Copy link
Contributor

JW-CH commented Mar 28, 2024

The bug

More Infos here: #8286

When declaring 'IMMICH_MEDIA_LOCATION' to '/photos' and trying to import an external library with the path '/photos_library', the validation says, 'Cannot use media upload folder for external libraries', which is wrong.

See additional information

The OS that Immich Server is running on

?

Version of Immich Server

v1.99

Version of Immich Mobile App

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

see https://github.com/immich-app/immich/discussions/8286

Your .env content

see https://github.com/immich-app/immich/discussions/8286

Reproduction steps

1. Set up env variable
2. Set up external library

Additional information

if (StorageCore.isImmichPath(importPath)) {
validation.message = 'Cannot use media upload folder for external libraries';
return validation;
}

static isImmichPath(path: string) {
return resolve(path).startsWith(resolve(APP_MEDIA_LOCATION));
}

@bo0tzz bo0tzz added bug Something isn't working good first issue Good for newcomers 🗄️server external-library Issues related to external libraries labels Mar 28, 2024
jrasm91 pushed a commit that referenced this issue Mar 31, 2024
* Fix isImmichPath

* prettier write

* Fis isImmichPath code comment

* Refactor isImmichPath function based on team suggestions

* Test isImmichPath

* fix: clean comments

* Refactor isImmichPath test based on team suggestions

* Clean code with lintern suggestions
@bo0tzz bo0tzz closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external-library Issues related to external libraries good first issue Good for newcomers 🗄️server
Projects
None yet
Development

No branches or pull requests

2 participants