1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-25 10:43:13 +02:00

fix(server): jobs using stale path (#2233)

* fix(server): jobs using stale path

* fixed test

* pr feedback
This commit is contained in:
Alex 2023-04-11 08:56:52 -05:00 committed by GitHub
parent 258bc328e0
commit dd8d113334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -213,6 +213,10 @@ describe(MediaService.name, () => {
});
describe('handleVideoConversion', () => {
beforeEach(() => {
assetMock.getByIds.mockResolvedValue([assetEntityStub.video]);
});
it('should log an error', async () => {
mediaMock.transcode.mockRejectedValue(new Error('unable to transcode'));

View File

@ -119,7 +119,11 @@ export class MediaService {
}
async handleVideoConversion(job: IAssetJob) {
const { asset } = job;
const [asset] = await this.assetRepository.getByIds([job.asset.id]);
if (!asset) {
return;
}
try {
const input = asset.originalPath;