1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

[video thumbnail] display the thumbnails for some pages.

- when 'video thumbnail' feature is enabled, display the thumbnails
  for 'dir view', 'starred(favorites)', 'file view', 'shared dir view'
  pages.
This commit is contained in:
llj
2021-07-19 14:46:17 +08:00
parent 4388bca9ce
commit 6bfd8cce96
12 changed files with 29 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import cookie from 'react-cookies';
import moment from 'moment';
import { gettext, siteRoot, username, isDocs } from '../../utils/constants';
import { gettext, siteRoot, username, isDocs, enableVideoThumbnail } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import collabServer from '../../utils/collab-server';
@@ -524,7 +524,7 @@ class LibContentView extends React.Component {
getThumbnails = (repoID, path, direntList) => {
let items = direntList.filter((item) => {
return Utils.imageCheck(item.name) && !item.encoded_thumbnail_src;
return (Utils.imageCheck(item.name) || (enableVideoThumbnail && Utils.videoCheck(item.name))) && !item.encoded_thumbnail_src;
});
if (items.length == 0) {
return ;