mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-12-14 04:05:14 +00:00
Make comments optional
Since they require CLIENT_ID
This commit is contained in:
@@ -5,4 +5,5 @@ export default {
|
||||
http_proxy: process.env.RIMGU_HTTP_PROXY || null,
|
||||
https_proxy: process.env.RIMGU_HTTPS_PROXY || null,
|
||||
imgur_client_id: process.env.RIMGU_IMGUR_CLIENT_ID || null,
|
||||
disable_comments: process.env.RIMGU_DISABLE_COMMENTS === 'true',
|
||||
};
|
||||
|
||||
@@ -3,6 +3,8 @@ import '@hapi/vision';
|
||||
import { fetchAlbumURL, fetchComments, fetchGallery, fetchMedia } from './fetchers';
|
||||
import * as util from './util';
|
||||
|
||||
import CONFIG from './config';
|
||||
|
||||
export const handleMedia = async (request: Hapi.Request, h: Hapi.ResponseToolkit) => {
|
||||
const {
|
||||
baseName,
|
||||
@@ -36,7 +38,9 @@ export const handleTag = (request: Hapi.Request, h: Hapi.ResponseToolkit) => {
|
||||
export const handleGallery = async (request: Hapi.Request, h: Hapi.ResponseToolkit) => {
|
||||
const galleryID = request.params.galleryID;
|
||||
const gallery = await fetchGallery(galleryID);
|
||||
const comments = await fetchComments(galleryID);
|
||||
const comments = CONFIG.disable_comments
|
||||
? null
|
||||
: await fetchComments(galleryID);
|
||||
return h.view('gallery', {
|
||||
...gallery,
|
||||
comments,
|
||||
|
||||
Reference in New Issue
Block a user