WEBSERVER
} from '../../initializers/constants'
import { VideoPlaylist } from '../../../shared/models/videos/playlist/video-playlist.model'
-import { AccountModel, ScopeNames as AccountScopeNames } from '../account/account'
+import { AccountModel, ScopeNames as AccountScopeNames, SummaryOptions } from '../account/account'
import { ScopeNames as VideoChannelScopeNames, VideoChannelModel } from './video-channel'
import { join } from 'path'
import { VideoPlaylistElementModel } from './video-playlist-element'
[ ScopeNames.AVAILABLE_FOR_LIST ]: (options: AvailableForListOptions) => {
// Only list local playlists OR playlists that are on an instance followed by actorId
const inQueryInstanceFollow = buildServerIdsFollowedBy(options.followerActorId)
- const actorWhere = {
+ const whereActor = {
[ Op.or ]: [
{
serverId: null
}
const accountScope = {
- method: [ AccountScopeNames.SUMMARY, actorWhere ]
+ method: [ AccountScopeNames.SUMMARY, { whereActor } as SummaryOptions ]
}
return {
VideoPlaylistElements: VideoPlaylistElementModel[]
@HasOne(() => ThumbnailModel, {
-
foreignKey: {
name: 'videoPlaylistId',
allowNull: true
},
include: [
{
- attributes: [ 'videoId', 'startTimestamp', 'stopTimestamp' ],
+ attributes: [ 'id', 'videoId', 'startTimestamp', 'stopTimestamp' ],
model: VideoPlaylistElementModel.unscoped(),
where: {
videoId: {
return !!this.Thumbnail
}
+ hasGeneratedThumbnail () {
+ return this.hasThumbnail() && this.Thumbnail.automaticallyGenerated === true
+ }
+
generateThumbnailName () {
const extension = '.jpg'