mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-01 01:35:11 +00:00
enable thumbnail cdn for all file thumbnails
This commit is contained in:
parent
05d625484d
commit
a5e9557e4b
1 changed files with 7 additions and 5 deletions
|
@ -6,6 +6,10 @@ import FreezeframeWrapper from './FreezeframeWrapper';
|
||||||
import Placeholder from './placeholder.png';
|
import Placeholder from './placeholder.png';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
|
||||||
|
const THUMBNAIL_HEIGHT = 180;
|
||||||
|
const THUMBNAIL_WIDTH = 320;
|
||||||
|
const THUMBNAIL_QUALITY = 100;
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
uri: string,
|
uri: string,
|
||||||
thumbnail: ?string, // externally sourced image
|
thumbnail: ?string, // externally sourced image
|
||||||
|
@ -42,12 +46,10 @@ function FileThumbnail(props: Props) {
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
// Pass image urls through a compression proxy
|
// Pass image urls through a compression proxy
|
||||||
if (thumbnail && THUMBNAIL_CDN_URL && !thumbnail.includes('https://spee.ch')) {
|
if (thumbnail && THUMBNAIL_CDN_URL && !thumbnail.includes('https://spee.ch')) {
|
||||||
// url = `${THUMBNAIL_CDN_URL}${thumbnail}&quality=75&height=288&width=512`;
|
url = `${THUMBNAIL_CDN_URL}${thumbnail}&quality=${THUMBNAIL_QUALITY}&height=${THUMBNAIL_HEIGHT}&width=${THUMBNAIL_WIDTH}`;
|
||||||
|
} else if (thumbnail && thumbnail.includes('https://spee.ch')) {
|
||||||
|
url = `${url}?quality=${THUMBNAIL_QUALITY}&height=${THUMBNAIL_HEIGHT}&width=${THUMBNAIL_WIDTH}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// else if (thumbnail && thumbnail.includes('https://spee.ch')) {
|
|
||||||
// url = `${url}?height=512&width=288`;
|
|
||||||
// }
|
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Reference in a new issue