chore(deps): update dependency eslint-plugin-unicorn to v72 (#30092)
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
1 parent
ce022233ae
commit
aa08dad1f5
27 files changed
+144
-149
No files matched your search
@@ -128,7 +128,7 @@ export class AssetMediaController {
|
||||
this.logger.deprecate(
|
||||
'Calling the thumbnail endpoint with size=original is deprecated. Use the :id/original endpoint instead',
|
||||
);
|
||||
const [_, reqSearch] = req.url.split('?');
|
||||
const [_, reqSearch] = req.url.split('?', 2);
|
||||
const redirSearchParams = new URLSearchParams(reqSearch);
|
||||
redirSearchParams.delete('size');
|
||||
return res.redirect('original?' + redirSearchParams.toString());
|
||||
@@ -142,7 +142,7 @@ export class AssetMediaController {
|
||||
// viewThumbnailRes is a AssetMediaRedirectResponse
|
||||
// which redirects to the original asset or a specific size to make better use of caching
|
||||
const { targetSize } = viewThumbnailRes;
|
||||
const [reqPath, reqSearch] = req.url.split('?');
|
||||
const [reqPath, reqSearch] = req.url.split('?', 2);
|
||||
let redirPath: string;
|
||||
const redirSearchParams = new URLSearchParams(reqSearch);
|
||||
if (targetSize === 'original') {
|
||||
|
||||
@@ -313,7 +313,7 @@ export class MediaRepository {
|
||||
if (!line) {
|
||||
return;
|
||||
}
|
||||
const [ptsStr, durationStr, flags] = line.split(',');
|
||||
const [ptsStr, durationStr, flags] = line.split(',', 3);
|
||||
const pts = Number.parseInt(ptsStr);
|
||||
const duration = Number.parseInt(durationStr);
|
||||
if (Number.isNaN(pts) || Number.isNaN(duration) || !flags) {
|
||||
|
||||
@@ -461,7 +461,7 @@ export class AuthService extends BaseService {
|
||||
}
|
||||
|
||||
private getBearerToken(headers: IncomingHttpHeaders): string | null {
|
||||
const [type, token] = (headers.authorization || '').split(' ');
|
||||
const [type, token] = (headers.authorization || '').split(' ', 2);
|
||||
if (type.toLowerCase() === 'bearer') {
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -214,7 +214,6 @@ export class DatabaseBackupService {
|
||||
bin: `/usr/lib/postgresql/${databaseMajorVersion}/bin/${bin}`,
|
||||
args,
|
||||
databaseUsername,
|
||||
// eslint-disable-next-line unicorn/prefer-minimal-ternary
|
||||
databasePassword: isUrlConnection ? new URL(databaseConfig.url).password : databaseConfig.password,
|
||||
databaseVersion,
|
||||
databaseMajorVersion,
|
||||
|
||||
@@ -15,6 +15,7 @@ import { makeStream, newTestService, ServiceMocks } from 'test/utils';
|
||||
import { vitest } from 'vitest';
|
||||
|
||||
async function* mockWalk() {
|
||||
// eslint-disable-next-line unicorn/no-useless-promise-resolve-reject
|
||||
yield await Promise.resolve(['/data/user1/photo.jpg']);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export class SystemConfigService extends BaseService {
|
||||
@OnEvent({ name: 'ConfigValidate' })
|
||||
onConfigValidate({ newConfig, oldConfig }: ArgOf<'ConfigValidate'>) {
|
||||
const { logLevel } = this.configRepository.getEnv();
|
||||
if (!_.isEqual(toPlainObject(newConfig.logging), oldConfig.logging) && logLevel) {
|
||||
if (logLevel && !_.isEqual(toPlainObject(newConfig.logging), oldConfig.logging)) {
|
||||
throw new Error('Logging cannot be changed while the environment variable IMMICH_LOG_LEVEL is set.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ export const mimeTypes = {
|
||||
return AssetType.Image;
|
||||
}
|
||||
|
||||
if (contentType.startsWith('video/') || contentType === 'application/mxf') {
|
||||
if (contentType === 'application/mxf' || contentType.startsWith('video/')) {
|
||||
return AssetType.Video;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ type Impossible<K extends keyof any> = {
|
||||
type Exact<T, U extends T = T> = U & Impossible<Exclude<keyof U, keyof T>>;
|
||||
|
||||
export const fromAck = (ack: string): SyncAck => {
|
||||
const [type, updateId, extraId] = ack.split('|');
|
||||
const [type, updateId, extraId] = ack.split('|', 3);
|
||||
return { type: type as SyncEntityType, updateId, extraId };
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user