import { VideoPrivacy } from '@peertube/peertube-models';
export function getInstanceRSSFeed(options) {
    const { url, title } = options;
    return { url: `${url}/feeds/videos.xml`, title };
}
export function getChannelRSSFeeds(options) {
    const { url, titles, channel } = options;
    return [
        {
            url: getChannelPodcastFeed(url, channel),
            title: titles.channelPodcastFeed
        },
        {
            url: `${url}/feeds/videos.xml?videoChannelId=${channel.id}`,
            title: titles.channelVideosFeed
        },
        getInstanceRSSFeed({ url, title: titles.instanceVideosFeed })
    ];
}
export function getVideoRSSFeeds(options) {
    const { url, titles, video } = options;
    if (video.privacy !== VideoPrivacy.PUBLIC) {
        return [getInstanceRSSFeed({ url, title: titles.instanceVideosFeed })];
    }
    return [
        {
            url: `${url}/feeds/video-comments.xml?videoId=${video.uuid}`,
            title: titles.videoCommentsFeed
        },
        getInstanceRSSFeed({ url, title: titles.instanceVideosFeed })
    ];
}
export function getChannelPodcastFeed(url, channel) {
    return `${url}/feeds/podcast/videos.xml?videoChannelId=${channel.id}`;
}
export function getPlaylistRSSFeeds(options) {
    const { url, titles, playlist } = options;
    return [
        {
            url: getPlaylistPodcastFeed(url, playlist),
            title: titles.playlistPodcastFeed
        },
        getInstanceRSSFeed({ url, title: titles.instanceVideosFeed })
    ];
}
export function getPlaylistPodcastFeed(url, playlist) {
    return `${url}/feeds/podcast/videos.xml?playlistId=${playlist.id}`;
}
//# sourceMappingURL=rss.js.map