mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 09:13:14 +03:00
* 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
This commit is contained in:
@@ -115,7 +115,13 @@ export class StorageCore {
|
||||
}
|
||||
|
||||
static isImmichPath(path: string) {
|
||||
return resolve(path).startsWith(resolve(APP_MEDIA_LOCATION));
|
||||
const resolvedPath = resolve(path);
|
||||
const resolvedAppMediaLocation = resolve(APP_MEDIA_LOCATION);
|
||||
const normalizedPath = resolvedPath.endsWith('/') ? resolvedPath : resolvedPath + '/';
|
||||
const normalizedAppMediaLocation = resolvedAppMediaLocation.endsWith('/')
|
||||
? resolvedAppMediaLocation
|
||||
: resolvedAppMediaLocation + '/';
|
||||
return normalizedPath.startsWith(normalizedAppMediaLocation);
|
||||
}
|
||||
|
||||
static isGeneratedAsset(path: string) {
|
||||
|
||||
Reference in New Issue
Block a user