diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-23 14:24:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-23 14:24:50 +0100 |
commit | 7e98a7df7d04e19ba67163a86c7b876d78d76839 (patch) | |
tree | 080c9bf63d2b00b43dca94e3c67cdc2a768308fc /server/lib/activitypub/playlists | |
parent | 5302f77d095c2188859ee463128aa59eec20ea88 (diff) | |
download | PeerTube-7e98a7df7d04e19ba67163a86c7b876d78d76839.tar.gz PeerTube-7e98a7df7d04e19ba67163a86c7b876d78d76839.tar.zst PeerTube-7e98a7df7d04e19ba67163a86c7b876d78d76839.zip |
Remove activitypub helper
Put functions in lib/activitypub instead
Diffstat (limited to 'server/lib/activitypub/playlists')
-rw-r--r-- | server/lib/activitypub/playlists/create-update.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/playlists/get.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/playlists/shared/url-to-object.ts | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/activitypub/playlists/create-update.ts b/server/lib/activitypub/playlists/create-update.ts index ef572c803..c28700be6 100644 --- a/server/lib/activitypub/playlists/create-update.ts +++ b/server/lib/activitypub/playlists/create-update.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { map } from 'bluebird' | 1 | import { map } from 'bluebird' |
2 | import { getAPId } from '@server/helpers/activitypub' | ||
3 | import { isArray } from '@server/helpers/custom-validators/misc' | 2 | import { isArray } from '@server/helpers/custom-validators/misc' |
4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
5 | import { CRAWL_REQUEST_CONCURRENCY } from '@server/initializers/constants' | 4 | import { CRAWL_REQUEST_CONCURRENCY } from '@server/initializers/constants' |
@@ -9,8 +8,9 @@ import { VideoPlaylistModel } from '@server/models/video/video-playlist' | |||
9 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' | 8 | import { VideoPlaylistElementModel } from '@server/models/video/video-playlist-element' |
10 | import { FilteredModelAttributes } from '@server/types' | 9 | import { FilteredModelAttributes } from '@server/types' |
11 | import { MThumbnail, MVideoPlaylist, MVideoPlaylistFull, MVideoPlaylistVideosLength } from '@server/types/models' | 10 | import { MThumbnail, MVideoPlaylist, MVideoPlaylistFull, MVideoPlaylistVideosLength } from '@server/types/models' |
12 | import { AttributesOnly } from '@shared/typescript-utils' | ||
13 | import { PlaylistObject } from '@shared/models' | 11 | import { PlaylistObject } from '@shared/models' |
12 | import { AttributesOnly } from '@shared/typescript-utils' | ||
13 | import { getAPId } from '../activity' | ||
14 | import { getOrCreateAPActor } from '../actors' | 14 | import { getOrCreateAPActor } from '../actors' |
15 | import { crawlCollectionPage } from '../crawl' | 15 | import { crawlCollectionPage } from '../crawl' |
16 | import { getOrCreateAPVideo } from '../videos' | 16 | import { getOrCreateAPVideo } from '../videos' |
diff --git a/server/lib/activitypub/playlists/get.ts b/server/lib/activitypub/playlists/get.ts index be8456b19..bfaf52cc9 100644 --- a/server/lib/activitypub/playlists/get.ts +++ b/server/lib/activitypub/playlists/get.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { getAPId } from '@server/helpers/activitypub' | ||
2 | import { VideoPlaylistModel } from '@server/models/video/video-playlist' | 1 | import { VideoPlaylistModel } from '@server/models/video/video-playlist' |
3 | import { MVideoPlaylistFullSummary } from '@server/types/models' | 2 | import { MVideoPlaylistFullSummary } from '@server/types/models' |
4 | import { APObject } from '@shared/models' | 3 | import { APObject } from '@shared/models' |
4 | import { getAPId } from '../activity' | ||
5 | import { createOrUpdateVideoPlaylist } from './create-update' | 5 | import { createOrUpdateVideoPlaylist } from './create-update' |
6 | import { scheduleRefreshIfNeeded } from './refresh' | 6 | import { scheduleRefreshIfNeeded } from './refresh' |
7 | import { fetchRemoteVideoPlaylist } from './shared' | 7 | import { fetchRemoteVideoPlaylist } from './shared' |
diff --git a/server/lib/activitypub/playlists/shared/url-to-object.ts b/server/lib/activitypub/playlists/shared/url-to-object.ts index ec8c01255..f895db587 100644 --- a/server/lib/activitypub/playlists/shared/url-to-object.ts +++ b/server/lib/activitypub/playlists/shared/url-to-object.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { isArray } from 'lodash' | 1 | import { isArray } from 'lodash' |
2 | import { checkUrlsSameHost } from '@server/helpers/activitypub' | ||
3 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' | 2 | import { isPlaylistElementObjectValid, isPlaylistObjectValid } from '@server/helpers/custom-validators/activitypub/playlist' |
4 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
5 | import { doJSONRequest } from '@server/helpers/requests' | 4 | import { doJSONRequest } from '@server/helpers/requests' |
6 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' | 5 | import { PlaylistElementObject, PlaylistObject } from '@shared/models' |
6 | import { checkUrlsSameHost } from '../../url' | ||
7 | 7 | ||
8 | async function fetchRemoteVideoPlaylist (playlistUrl: string): Promise<{ statusCode: number, playlistObject: PlaylistObject }> { | 8 | async function fetchRemoteVideoPlaylist (playlistUrl: string): Promise<{ statusCode: number, playlistObject: PlaylistObject }> { |
9 | const lTags = loggerTagsFactory('ap', 'video-playlist', playlistUrl) | 9 | const lTags = loggerTagsFactory('ap', 'video-playlist', playlistUrl) |