diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-04 11:17:08 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-04 11:17:08 +0100 |
commit | be44767854709dbf7da4ba37fe4f16ac4e297f08 (patch) | |
tree | 93cc7c992a205f3ea76126b5f3035f3a9440e9a4 | |
parent | d2cc03aaad62fa6cf1c64622229bcc83f24fccb6 (diff) | |
download | PeerTube-be44767854709dbf7da4ba37fe4f16ac4e297f08.tar.gz PeerTube-be44767854709dbf7da4ba37fe4f16ac4e297f08.tar.zst PeerTube-be44767854709dbf7da4ba37fe4f16ac4e297f08.zip |
Fix lint
8 files changed, 8 insertions, 11 deletions
diff --git a/client/src/app/account/account-videos/account-videos.component.html b/client/src/app/account/account-videos/account-videos.component.html index 94b976869..eb0a32fd3 100644 --- a/client/src/app/account/account-videos/account-videos.component.html +++ b/client/src/app/account/account-videos/account-videos.component.html | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | <div class="video-info"> | 9 | <div class="video-info"> |
10 | <div class="video-info-name">{{ video.name }}</div> | 10 | <div class="video-info-name">{{ video.name }}</div> |
11 | <span class="video-info-date-views">{{ video.createdAt | fromNow }} - {{ video.views | numberFormatter }} views</span> | 11 | <span class="video-info-date-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span> |
12 | </div> | 12 | </div> |
13 | 13 | ||
14 | <a class="edit-button" [routerLink]="[ '/videos', video.id, '/edit' ]"> | 14 | <a class="edit-button" [routerLink]="[ '/videos', video.id, '/edit' ]"> |
diff --git a/client/src/app/account/account-videos/account-videos.component.ts b/client/src/app/account/account-videos/account-videos.component.ts index ff945825d..cc28f511a 100644 --- a/client/src/app/account/account-videos/account-videos.component.ts +++ b/client/src/app/account/account-videos/account-videos.component.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { Component, OnDestroy, OnInit } from '@angular/core' | 1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | 2 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { ActivatedRoute } from '@angular/router' | ||
4 | import { Router } from '@angular/router' | ||
5 | import { NotificationsService } from 'angular2-notifications' | 3 | import { NotificationsService } from 'angular2-notifications' |
4 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | ||
6 | import { VideoService } from '../../shared/video/video.service' | 5 | import { VideoService } from '../../shared/video/video.service' |
7 | 6 | ||
8 | @Component({ | 7 | @Component({ |
diff --git a/client/src/app/shared/misc/from-now.pipe.ts b/client/src/app/shared/misc/from-now.pipe.ts index 80dab02ba..fac02af0b 100644 --- a/client/src/app/shared/misc/from-now.pipe.ts +++ b/client/src/app/shared/misc/from-now.pipe.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import { Pipe, PipeTransform } from '@angular/core' | 1 | import { Pipe, PipeTransform } from '@angular/core' |
2 | 2 | ||
3 | // Thanks: https://stackoverflow.com/questions/3177836/how-to-format-time-since-xxx-e-g-4-minutes-ago-similar-to-stack-exchange-site | 3 | // Thanks: https://stackoverflow.com/questions/3177836/how-to-format-time-since-xxx-e-g-4-minutes-ago-similar-to-stack-exchange-site |
4 | 4 | @Pipe({ name: 'myFromNow' }) | |
5 | @Pipe({name: 'fromNow'}) | ||
6 | export class FromNowPipe implements PipeTransform { | 5 | export class FromNowPipe implements PipeTransform { |
7 | 6 | ||
8 | transform (value: number) { | 7 | transform (value: number) { |
diff --git a/client/src/app/shared/misc/number-formatter.pipe.ts b/client/src/app/shared/misc/number-formatter.pipe.ts index 2491fb1d6..8a0756a36 100644 --- a/client/src/app/shared/misc/number-formatter.pipe.ts +++ b/client/src/app/shared/misc/number-formatter.pipe.ts | |||
@@ -2,7 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core' | |||
2 | 2 | ||
3 | // Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts | 3 | // Thanks: https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts |
4 | 4 | ||
5 | @Pipe({name: 'numberFormatter'}) | 5 | @Pipe({ name: 'myNumberFormatter' }) |
6 | export class NumberFormatterPipe implements PipeTransform { | 6 | export class NumberFormatterPipe implements PipeTransform { |
7 | private dictionary: Array<{max: number, type: string}> = [ | 7 | private dictionary: Array<{max: number, type: string}> = [ |
8 | { max: 1000, type: '' }, | 8 | { max: 1000, type: '' }, |
diff --git a/client/src/app/videos/video-list/shared/video-miniature.component.html b/client/src/app/videos/video-list/shared/video-miniature.component.html index f2756ca3d..7ac017235 100644 --- a/client/src/app/videos/video-list/shared/video-miniature.component.html +++ b/client/src/app/videos/video-list/shared/video-miniature.component.html | |||
@@ -11,7 +11,7 @@ | |||
11 | </a> | 11 | </a> |
12 | </span> | 12 | </span> |
13 | 13 | ||
14 | <span class="video-miniature-created-at-views">{{ video.createdAt | fromNow }} - {{ video.views | numberFormatter }} views</span> | 14 | <span class="video-miniature-created-at-views">{{ video.createdAt | myFromNow }} - {{ video.views | myNumberFormatter }} views</span> |
15 | <span class="video-miniature-account">{{ video.by }}</span> | 15 | <span class="video-miniature-account">{{ video.by }}</span> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
diff --git a/server/initializers/migrations/0115-account-avatar.ts b/server/initializers/migrations/0115-account-avatar.ts index e3531f5ce..2b947ceda 100644 --- a/server/initializers/migrations/0115-account-avatar.ts +++ b/server/initializers/migrations/0115-account-avatar.ts | |||
@@ -7,7 +7,7 @@ async function up (utils: { | |||
7 | sequelize: Sequelize.Sequelize, | 7 | sequelize: Sequelize.Sequelize, |
8 | db: PeerTubeDatabase | 8 | db: PeerTubeDatabase |
9 | }): Promise<void> { | 9 | }): Promise<void> { |
10 | await db.Avatar.sync() | 10 | await utils.db.Avatar.sync() |
11 | 11 | ||
12 | const data = { | 12 | const data = { |
13 | type: Sequelize.INTEGER, | 13 | type: Sequelize.INTEGER, |
diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 15be1126b..8b0819f39 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts | |||
@@ -13,7 +13,6 @@ import { isActivityPubUrlValid } from '../../helpers/custom-validators/activityp | |||
13 | import { AVATARS_DIR } from '../../initializers' | 13 | import { AVATARS_DIR } from '../../initializers' |
14 | import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers/constants' | 14 | import { CONFIG, CONSTRAINTS_FIELDS } from '../../initializers/constants' |
15 | import { sendDeleteAccount } from '../../lib/activitypub/send/send-delete' | 15 | import { sendDeleteAccount } from '../../lib/activitypub/send/send-delete' |
16 | import { AvatarModel } from '../avatar' | ||
17 | import { addMethodsToModel } from '../utils' | 16 | import { addMethodsToModel } from '../utils' |
18 | import { AccountAttributes, AccountInstance, AccountMethods } from './account-interface' | 17 | import { AccountAttributes, AccountInstance, AccountMethods } from './account-interface' |
19 | 18 | ||
diff --git a/server/models/avatar/avatar.ts b/server/models/avatar/avatar.ts index 3d329d888..96308fd5f 100644 --- a/server/models/avatar/avatar.ts +++ b/server/models/avatar/avatar.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { addMethodsToModel } from '../utils' | 2 | import { addMethodsToModel } from '../utils' |
3 | import { AvatarAttributes, AvatarInstance, AvatarMethods } from './avatar-interface' | 3 | import { AvatarAttributes, AvatarInstance } from './avatar-interface' |
4 | 4 | ||
5 | let Avatar: Sequelize.Model<AvatarInstance, AvatarAttributes> | 5 | let Avatar: Sequelize.Model<AvatarInstance, AvatarAttributes> |
6 | 6 | ||