feat(cache): add cache table and flush cache option to settings

also increases tmdb cache times to about 6 hours (12 hours for detail requests)
This commit is contained in:
sct
2021-01-31 13:11:12 +00:00
parent 3c5ae360fd
commit 996bd9f14e
12 changed files with 363 additions and 178 deletions

View File

@@ -7,18 +7,7 @@ import type {
ServiceCommonServerWithDetails,
} from '../../../../server/interfaces/api/serviceInterfaces';
import { defineMessages, useIntl } from 'react-intl';
const formatBytes = (bytes: number, decimals = 2) => {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
};
import { formatBytes } from '../../../utils/numberHelpers';
const messages = defineMessages({
advancedoptions: 'Advanced Options',