Skip to content

Commit

Permalink
fix(server): use extension in originalFileName for libraries (#8083)
Browse files Browse the repository at this point in the history
* use file base

* fix: test

* fix: e2e-job tests

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
  • Loading branch information
etnoy and alextran1502 committed Mar 20, 2024
1 parent f908bd4 commit e6f2bb9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions server/e2e/jobs/specs/library.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ describe(`${LibraryController.name} (e2e)`, () => {
expect.arrayContaining([
expect.objectContaining({
isOffline: true,
originalFileName: 'el_torcal_rocks',
originalFileName: 'el_torcal_rocks.jpg',
}),
expect.objectContaining({
isOffline: true,
originalFileName: 'tanners_ridge',
originalFileName: 'tanners_ridge.jpg',
}),
]),
);
Expand Down Expand Up @@ -97,10 +97,10 @@ describe(`${LibraryController.name} (e2e)`, () => {
expect(assets).toEqual(
expect.arrayContaining([
expect.objectContaining({
originalFileName: 'el_torcal_rocks',
originalFileName: 'el_torcal_rocks.jpg',
}),
expect.objectContaining({
originalFileName: 'silver_fir',
originalFileName: 'silver_fir.jpg',
}),
]),
);
Expand Down Expand Up @@ -137,7 +137,7 @@ describe(`${LibraryController.name} (e2e)`, () => {

expect(assets[0]).toEqual(
expect.objectContaining({
originalFileName: 'el_torcal_rocks',
originalFileName: 'el_torcal_rocks.jpg',
exifInfo: expect.objectContaining({
dateTimeOriginal: '2023-09-25T08:33:30.880Z',
exifImageHeight: 534,
Expand Down Expand Up @@ -184,7 +184,7 @@ describe(`${LibraryController.name} (e2e)`, () => {

expect(assets[0]).toEqual(
expect.objectContaining({
originalFileName: 'el_torcal_rocks',
originalFileName: 'el_torcal_rocks.jpg',
exifInfo: expect.objectContaining({
dateTimeOriginal: '2012-08-05T11:39:59.000Z',
}),
Expand Down Expand Up @@ -224,7 +224,7 @@ describe(`${LibraryController.name} (e2e)`, () => {

expect(assets[0]).toEqual(
expect.objectContaining({
originalFileName: 'el_torcal_rocks',
originalFileName: 'el_torcal_rocks.jpg',
exifInfo: expect.objectContaining({
exifImageHeight: 534,
exifImageWidth: 800,
Expand Down
6 changes: 3 additions & 3 deletions server/src/domain/library/library.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe(LibraryService.name, () => {
fileModifiedAt: expect.any(Date),
localDateTime: expect.any(Date),
type: AssetType.IMAGE,
originalFileName: 'photo',
originalFileName: 'photo.jpg',
sidecarPath: null,
isReadOnly: true,
isExternal: true,
Expand Down Expand Up @@ -425,7 +425,7 @@ describe(LibraryService.name, () => {
fileModifiedAt: expect.any(Date),
localDateTime: expect.any(Date),
type: AssetType.IMAGE,
originalFileName: 'photo',
originalFileName: 'photo.jpg',
sidecarPath: '/data/user1/photo.jpg.xmp',
isReadOnly: true,
isExternal: true,
Expand Down Expand Up @@ -472,7 +472,7 @@ describe(LibraryService.name, () => {
fileModifiedAt: expect.any(Date),
localDateTime: expect.any(Date),
type: AssetType.VIDEO,
originalFileName: 'video',
originalFileName: 'video.mp4',
sidecarPath: null,
isReadOnly: true,
isExternal: true,
Expand Down
2 changes: 1 addition & 1 deletion server/src/domain/library/library.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ export class LibraryService extends EventEmitter {
fileModifiedAt: stats.mtime,
localDateTime: stats.mtime,
type: assetType,
originalFileName: parse(assetPath).name,
originalFileName: parse(assetPath).base,
sidecarPath,
isReadOnly: true,
isExternal: true,
Expand Down

0 comments on commit e6f2bb9

Please sign in to comment.