1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 07:01:12 +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

@@ -24,7 +24,7 @@ let {
repoID, relativePath,
mode, thumbnailSize, zipped,
trafficOverLimit, canDownload,
noQuota, canUpload
noQuota, canUpload, enableVideoThumbnail
} = window.shared.pageOptions;
const showDownloadIcon = !trafficOverLimit && canDownload;
@@ -90,7 +90,10 @@ class SharedDirView extends React.Component {
getThumbnails = () => {
let items = this.state.items.filter((item) => {
return !item.is_dir && Utils.imageCheck(item.file_name) && !item.encoded_thumbnail_src;
return !item.is_dir &&
(Utils.imageCheck(item.file_name) ||
(enableVideoThumbnail && Utils.videoCheck(item.file_name))) &&
!item.encoded_thumbnail_src;
});
if (items.length == 0) {
return ;