mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
f1d8ab8aae
* track video metadata * earlier duration check * revert colorspace change * duplicate constant * formatting * linting * add comments * redundant variable * simplify tests * use totalDuration instead of format.duration * medium tests * install ffmpeg * install noble * update test-assets commit * make timeBase non-nullable * linting * use proper smallint * add ffmpeg to mise * simplify duration * regenerate migration
26 lines
1003 B
TypeScript
26 lines
1003 B
TypeScript
import { MediaRepository } from 'src/repositories/media.repository';
|
|
import { RepositoryInterface } from 'src/types';
|
|
import { Mocked, vitest } from 'vitest';
|
|
|
|
export const newMediaRepositoryMock = (): Mocked<RepositoryInterface<MediaRepository>> => {
|
|
return {
|
|
generateThumbnail: vitest.fn().mockImplementation(() => Promise.resolve()),
|
|
writeExif: vitest.fn().mockImplementation(() => Promise.resolve()),
|
|
copyTagGroup: vitest.fn().mockImplementation(() => Promise.resolve()),
|
|
generateThumbhash: vitest.fn().mockResolvedValue(Buffer.from('')),
|
|
decodeImage: vitest.fn().mockResolvedValue({ data: Buffer.from(''), info: {} }),
|
|
extract: vitest.fn().mockResolvedValue(null),
|
|
probe: vitest.fn(),
|
|
probePackets: vitest.fn().mockResolvedValue({
|
|
totalDuration: 0,
|
|
packetCount: 0,
|
|
outputFrames: 0,
|
|
keyframePts: [],
|
|
keyframeAccDuration: [],
|
|
keyframeOwnDuration: [],
|
|
}),
|
|
transcode: vitest.fn(),
|
|
getImageMetadata: vitest.fn(),
|
|
};
|
|
};
|