MUserFormattable,
MUserNotifSettingChannelDefault,
MUserWithNotificationSetting,
- MVideoFullLight
+ MVideoWithRights
} from '@server/types/models'
import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users'
import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models'
static loadByUsername (username: string): Promise<MUserDefault> {
const query = {
where: {
- username: { [Op.iLike]: username }
+ username
}
}
return UserModel.findOne(query)
}
- static loadForMeAPI (username: string): Promise<MUserNotifSettingChannelDefault> {
+ static loadForMeAPI (id: number): Promise<MUserNotifSettingChannelDefault> {
const query = {
where: {
- username: { [Op.iLike]: username }
+ id
}
}
const totalDailyActiveUsers = await getActiveUsers(1)
const totalWeeklyActiveUsers = await getActiveUsers(7)
const totalMonthlyActiveUsers = await getActiveUsers(30)
+ const totalHalfYearActiveUsers = await getActiveUsers(180)
return {
totalUsers,
totalDailyActiveUsers,
totalWeeklyActiveUsers,
- totalMonthlyActiveUsers
+ totalMonthlyActiveUsers,
+ totalHalfYearActiveUsers
}
}
.then(u => u.map(u => u.username))
}
- canGetVideo (video: MVideoFullLight) {
+ canGetVideo (video: MVideoWithRights) {
const videoUserId = video.VideoChannel.Account.userId
if (video.isBlacklisted()) {