- static listPublicUrlsOfForAP (accountId: number, start: number, count: number) {
- const query = {
- attributes: [ 'url' ],
- offset: start,
- limit: count,
- where: {
- ownerAccountId: accountId,
- privacy: VideoPlaylistPrivacy.PUBLIC
+ static searchForApi (options: Pick<AvailableForListOptions, 'followerActorId' | 'search' | 'host' | 'uuids'> & {
+ start: number
+ count: number
+ sort: string
+ }) {
+ return VideoPlaylistModel.listForApi({
+ ...options,
+
+ type: VideoPlaylistType.REGULAR,
+ listMyPlaylists: false,
+ withVideos: true
+ })
+ }
+
+ static listPublicUrlsOfForAP (options: { account?: MAccountId, channel?: MChannelId }, start: number, count: number) {
+ const where = {
+ privacy: VideoPlaylistPrivacy.PUBLIC
+ }
+
+ if (options.account) {
+ Object.assign(where, { ownerAccountId: options.account.id })
+ }
+
+ if (options.channel) {
+ Object.assign(where, { videoChannelId: options.channel.id })
+ }
+
+ const getQuery = (forCount: boolean) => {
+ return {
+ attributes: forCount === true
+ ? []
+ : [ 'url' ],
+ offset: start,
+ limit: count,
+ where