let loadAndPopulateAuthorAndPodAndTags: VideoMethods.LoadAndPopulateAuthorAndPodAndTags
let searchAndPopulateAuthorAndPodAndTags: VideoMethods.SearchAndPopulateAuthorAndPodAndTags
-export default function (sequelize, DataTypes) {
- Video = sequelize.define('Video',
+export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) {
+ Video = sequelize.define<VideoInstance, VideoAttributes>('Video',
{
id: {
type: DataTypes.UUID,
return this.remoteId === null
}
-toFormatedJSON = function () {
+toFormatedJSON = function (this: VideoInstance) {
let podHost
if (this.Author.Pod) {
views: this.views,
likes: this.likes,
dislikes: this.dislikes,
- tags: map(this.Tags, 'name'),
+ tags: map<VideoTagInstance, string>(this.Tags, 'name'),
thumbnailPath: join(STATIC_PATHS.THUMBNAILS, this.getThumbnailName()),
createdAt: this.createdAt,
updatedAt: this.updatedAt