Skip to content

Commit

Permalink
rename folder size pipe for clarity; minor formatting (#869)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyboris authored Oct 23, 2024
1 parent c1efd8b commit f139ef8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
4 changes: 1 addition & 3 deletions src/app/components/sheet/sheet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export interface DefaultScreenEmission {
styleUrls: [ './../buttons.scss',
'./../views/time-and-rez.scss',
'./sheet.component.scss' ],
animations: [ modalAnimation,
textAppear,
metaAppear ]
animations: [ modalAnimation, textAppear, metaAppear ]
})
export class SheetComponent implements OnInit {

Expand Down
3 changes: 1 addition & 2 deletions src/app/components/views/clip/clip.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import { metaAppear, textAppear } from '../../../common/animations';
'./clip.component.scss',
'../selected.scss'
],
animations: [ textAppear,
metaAppear ]
animations: [ textAppear, metaAppear ]
})
export class ClipComponent implements OnInit {

Expand Down
3 changes: 1 addition & 2 deletions src/app/components/views/filmstrip/filmstrip.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ import type { RightClickEmit, VideoClickEmit } from '../../../../../interfaces/s
'../selected.scss',
'./filmstrip.component.scss'
],
animations: [ textAppear,
metaAppear ]
animations: [ textAppear, metaAppear ]
})
export class FilmstripComponent implements OnInit {

Expand Down
3 changes: 1 addition & 2 deletions src/app/components/views/full/full.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import type { RightClickEmit, VideoClickEmit } from '../../../../../interfaces/s
'../film-and-full.scss',
'../selected.scss'
],
animations: [ textAppear,
metaAppear ]
animations: [ textAppear, metaAppear ]
})
export class FullViewComponent implements OnInit {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<div *ngIf="video.cleanName === '*FOLDER*' && video.fileName !== '*UP*'" class="folder-icon">
<app-icon [icon]="'icon-folder-blank'"></app-icon>
<div class="items-in-folder">{{ video.fileSizeDisplay | folderSize }}</div>
<div class="items-in-folder">{{ video.fileSizeDisplay | folderSizePipe }}</div>
</div>

<span
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/views/thumbnail/thumbnail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import type { VideoClickEmit, RightClickEmit } from '../../../../../interfaces/s
'./thumbnail.component.scss',
'../selected.scss'
],
animations: [textAppear,
metaAppear]
animations: [textAppear, metaAppear]
})
export class ThumbnailComponent implements OnInit, OnDestroy {

Expand Down
8 changes: 4 additions & 4 deletions src/app/pipes/folder-size.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
name: 'folderSize'
name: 'folderSizePipe'
})
export class FolderSizePipe implements PipeTransform {
transform(value: any, ...args: any[]): any {
const fileCount = parseInt(value, 10);
transform(numberOfFiles: string): any {
const fileCount = parseInt(numberOfFiles, 10);
if (fileCount >= 1000) {
return Math.floor(fileCount / 1000) + 'k';
} else {
return value;
return numberOfFiles;
}
}
}

0 comments on commit f139ef8

Please sign in to comment.