1
0
Fork 0
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:
kontrollanten 2024-10-23 07:17:02 +02:00 committed by GitHub
parent ef1732e5b9
commit 41c70a6b35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 138 additions and 51 deletions

View file

@ -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',