mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Sitemap: Hide empty accounts/channels and add video tags (#6633)
* feat(sitemap): remove empty accounts/channels closes #6607 * feat(sitemap): add more video tags https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps closes #6606 * Chunk videos SQL query * Optimize SQL query --------- Co-authored-by: Chocobozzz <me@florianbigard.com>
This commit is contained in:
parent
ef1732e5b9
commit
41c70a6b35
8 changed files with 138 additions and 51 deletions
|
@ -417,14 +417,17 @@ export class VideosCommand extends AbstractCommand {
|
|||
mode?: 'legacy' | 'resumable' // default legacy
|
||||
waitTorrentGeneration?: boolean // default true
|
||||
completedExpectedStatus?: HttpStatusCodeType
|
||||
videoChannelId?: number
|
||||
} = {}) {
|
||||
const { mode = 'legacy', waitTorrentGeneration = true } = options
|
||||
const { mode = 'legacy', videoChannelId, waitTorrentGeneration = true } = options
|
||||
let defaultChannelId = 1
|
||||
|
||||
try {
|
||||
const { videoChannels } = await this.server.users.getMyInfo({ token: options.token })
|
||||
defaultChannelId = videoChannels[0].id
|
||||
} catch (e) { /* empty */ }
|
||||
if (!videoChannelId) {
|
||||
try {
|
||||
const { videoChannels } = await this.server.users.getMyInfo({ token: options.token })
|
||||
defaultChannelId = videoChannels[0].id
|
||||
} catch (e) { /* empty */ }
|
||||
}
|
||||
|
||||
// Override default attributes
|
||||
const attributes = {
|
||||
|
@ -432,7 +435,7 @@ export class VideosCommand extends AbstractCommand {
|
|||
category: 5,
|
||||
licence: 4,
|
||||
language: 'zh',
|
||||
channelId: defaultChannelId,
|
||||
channelId: videoChannelId || defaultChannelId,
|
||||
nsfw: true,
|
||||
waitTranscoding: false,
|
||||
description: 'my super description',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue