3
0
mirror of https://github.com/Qortal/q-tube.git synced 2025-02-11 17:55:51 +00:00

Merge pull request #52 from QortalSeth/main

fileSize and duration don't show if they are below a minimum value.
This commit is contained in:
Qortal Dev 2024-11-19 08:33:41 -07:00 committed by GitHub
commit 26d6494e18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 35 deletions

View File

@ -1,4 +1,5 @@
import { Box, CircularProgress, Typography } from "@mui/material"; import { Box, CircularProgress, Typography } from "@mui/material";
import { minDuration } from "../../../../constants/Misc.ts";
import { setVideoPlaying } from "../../../../state/features/globalSlice.ts"; import { setVideoPlaying } from "../../../../state/features/globalSlice.ts";
import { useDispatch } from "react-redux"; import { useDispatch } from "react-redux";
import { PlayArrow } from "@mui/icons-material"; import { PlayArrow } from "@mui/icons-material";
@ -88,7 +89,7 @@ export const LoadingVideo = () => {
{((!src && !isLoading.value) || (!startPlay.value && !canPlay.value)) && ( {((!src && !isLoading.value) || (!startPlay.value && !canPlay.value)) && (
<> <>
{duration && ( {duration > minDuration && (
<Box <Box
position="absolute" position="absolute"
right={0} right={0}

View File

@ -12,3 +12,5 @@ export const fontSizeMedium = "100%";
export const fontSizeLarge = "120%"; export const fontSizeLarge = "120%";
export const fontSizeExLarge = "150%"; export const fontSizeExLarge = "150%";
export const maxCommentLength = 10_000; export const maxCommentLength = 10_000;
export const minFileSize = 1_000;
export const minDuration = 5;

View File

@ -1,47 +1,22 @@
import { Avatar, Box, Typography, useTheme } from "@mui/material"; import { Box, Typography } from "@mui/material";
import React from "react"; import React from "react";
import DeletedVideo from "../../../assets/img/DeletedVideo.jpg"; import DeletedVideo from "../../../assets/img/DeletedVideo.jpg";
import { CommentSection } from "../../../components/common/Comments/CommentSection.tsx"; import { CommentSection } from "../../../components/common/Comments/CommentSection.tsx";
import { SuperLikesSection } from "../../../components/common/SuperLikesList/SuperLikesSection.tsx"; import { SuperLikesSection } from "../../../components/common/SuperLikesList/SuperLikesSection.tsx";
import { DisplayHtml } from "../../../components/common/TextEditor/DisplayHtml.tsx"; import { DisplayHtml } from "../../../components/common/TextEditor/DisplayHtml.tsx";
import { import { VideoPlayer } from "../../../components/common/VideoPlayer/VideoPlayer.tsx";
videoRefType, import { minFileSize } from "../../../constants/Misc.ts";
VideoPlayer,
} from "../../../components/common/VideoPlayer/VideoPlayer.tsx";
import {
QTUBE_VIDEO_BASE,
SUPER_LIKE_BASE,
} from "../../../constants/Identifiers.ts";
import {
fontSizeMedium,
minPriceSuperlike,
titleFormatterOnSave,
} from "../../../constants/Misc.ts";
import { useFetchSuperLikes } from "../../../hooks/useFetchSuperLikes.tsx";
import { setIsLoadingGlobal } from "../../../state/features/globalSlice.ts";
import { addToHashMap } from "../../../state/features/videoSlice.ts";
import { RootState } from "../../../state/store.ts";
import { formatBytes } from "../../../utils/numberFunctions.ts"; import { formatBytes } from "../../../utils/numberFunctions.ts";
import { formatDate } from "../../../utils/time.ts"; import { formatDate } from "../../../utils/time.ts";
import { VideoActionsBar } from "./VideoActionsBar.tsx"; import { VideoActionsBar } from "./VideoActionsBar.tsx";
import { useVideoContentState } from "./VideoContent-State.ts";
import { import {
extractSigValue,
getPaymentInfo,
isTimestampWithinRange,
useVideoContentState,
} from "./VideoContent-State.ts";
import {
AuthorTextComment,
FileAttachmentContainer,
FileAttachmentFont,
Spacer, Spacer,
StyledCardColComment,
StyledCardHeaderComment,
VideoDescription,
VideoContentContainer, VideoContentContainer,
VideoTitle, VideoDescription,
VideoPlayerContainer, VideoPlayerContainer,
VideoTitle,
} from "./VideoContent-styles.tsx"; } from "./VideoContent-styles.tsx";
export const VideoContent = () => { export const VideoContent = () => {
@ -130,7 +105,7 @@ export const VideoContent = () => {
{videoData?.title} {videoData?.title}
</VideoTitle> </VideoTitle>
</Box> </Box>
{videoData?.fileSize && ( {videoData?.fileSize > minFileSize && (
<Typography <Typography
variant="h1" variant="h1"
sx={{ sx={{

View File

@ -6,7 +6,7 @@ import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { PlaylistSVG } from "../../../assets/svgs/PlaylistSVG.tsx"; import { PlaylistSVG } from "../../../assets/svgs/PlaylistSVG.tsx";
import ResponsiveImage from "../../../components/ResponsiveImage.tsx"; import ResponsiveImage from "../../../components/ResponsiveImage.tsx";
import { fontSizeSmall } from "../../../constants/Misc.ts"; import { fontSizeSmall, minDuration } from "../../../constants/Misc.ts";
import { import {
blockUser, blockUser,
setEditPlaylist, setEditPlaylist,
@ -236,7 +236,7 @@ export const VideoList = ({ videos }: VideoListProps) => {
navigate(`/video/${videoObj?.user}/${videoObj?.id}`); navigate(`/video/${videoObj?.user}/${videoObj?.id}`);
}} }}
> >
{videoObj?.duration && ( {videoObj?.duration > minDuration && (
<Box <Box
position="absolute" position="absolute"
right={0} right={0}