mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 04:09:07 +00:00
chore(docs): contributing (#1311)
* chore(server): linting * chore: contributing pr checklist
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import {ApiProperty} from "@nestjs/swagger";
|
||||
import {AlbumResponseDto} from "./album-response.dto";
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { AlbumResponseDto } from './album-response.dto';
|
||||
|
||||
export class AddAssetsResponseDto {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
successfullyAdded!: number;
|
||||
@ApiProperty({ type: 'integer' })
|
||||
successfullyAdded!: number;
|
||||
|
||||
@ApiProperty()
|
||||
alreadyInAlbum!: string[];
|
||||
@ApiProperty()
|
||||
alreadyInAlbum!: string[];
|
||||
|
||||
@ApiProperty()
|
||||
album?: AlbumResponseDto;
|
||||
}
|
||||
@ApiProperty()
|
||||
album?: AlbumResponseDto;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
export class CheckExistingAssetsResponseDto {
|
||||
constructor(existingIds: string[]) {
|
||||
this.existingIds = existingIds;
|
||||
}
|
||||
existingIds: string[];
|
||||
constructor(existingIds: string[]) {
|
||||
this.existingIds = existingIds;
|
||||
}
|
||||
|
||||
existingIds: string[];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { UpdateTagDto } from './dto/update-tag.dto';
|
||||
import { Authenticated } from '../../decorators/authenticated.decorator';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { AuthUserDto, GetAuthUser } from '../../decorators/auth-user.decorator';
|
||||
import { mapTag, TagResponseDto } from "./response-dto/tag-response.dto";
|
||||
import { mapTag, TagResponseDto } from './response-dto/tag-response.dto';
|
||||
|
||||
@Authenticated()
|
||||
@ApiTags('Tag')
|
||||
@@ -14,7 +14,10 @@ export class TagController {
|
||||
constructor(private readonly tagService: TagService) {}
|
||||
|
||||
@Post()
|
||||
create(@GetAuthUser() authUser: AuthUserDto, @Body(ValidationPipe) createTagDto: CreateTagDto): Promise<TagResponseDto> {
|
||||
create(
|
||||
@GetAuthUser() authUser: AuthUserDto,
|
||||
@Body(ValidationPipe) createTagDto: CreateTagDto,
|
||||
): Promise<TagResponseDto> {
|
||||
return this.tagService.create(authUser, createTagDto);
|
||||
}
|
||||
|
||||
@@ -34,7 +37,7 @@ export class TagController {
|
||||
@GetAuthUser() authUser: AuthUserDto,
|
||||
@Param('id') id: string,
|
||||
@Body(ValidationPipe) updateTagDto: UpdateTagDto,
|
||||
): Promise<TagResponseDto> {
|
||||
): Promise<TagResponseDto> {
|
||||
return this.tagService.update(authUser, id, updateTagDto);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,17 +9,16 @@ export const HumanReadableSize = { KiB, MiB, GiB, TiB, PiB };
|
||||
export function asHumanReadable(bytes: number, precision = 1): string {
|
||||
const units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];
|
||||
|
||||
let magnitude = 0;
|
||||
let remainder = bytes;
|
||||
while (remainder >= 1024) {
|
||||
if (magnitude + 1 < units.length) {
|
||||
magnitude++;
|
||||
remainder /= 1024;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let magnitude = 0;
|
||||
let remainder = bytes;
|
||||
while (remainder >= 1024) {
|
||||
if (magnitude + 1 < units.length) {
|
||||
magnitude++;
|
||||
remainder /= 1024;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return `${remainder.toFixed( magnitude == 0 ? 0 : precision )} ${units[magnitude]}`;
|
||||
return `${remainder.toFixed(magnitude == 0 ? 0 : precision)} ${units[magnitude]}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user