3
0
mirror of https://github.com/Qortal/q-tube.git synced 2025-02-11 17:55:51 +00:00
This commit is contained in:
Qortal Dev 2024-01-19 16:20:42 -07:00
commit cf95cd02ef
4 changed files with 47 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -44,14 +44,13 @@ export default function ConsentModal() {
<DialogTitle id="alert-dialog-title">Welcome</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
Q-Tube is currently in its first version and as such there could be
some bugs. The Qortal community, along with its development team and
the creators of this application, cannot be held accountable for any
content published or displayed. Also, they are not responsible for
any loss of coin due to either bad actors or bugs in the
application. Furthermore, they bear no responsibility for any data
loss that may occur as a result of using this application. Finally, they bear no responsibility for any of the content uploaded by users.
</DialogContentText>
Q-Tube is currently in its early stages, and may yet have undiscovered bugs.
The Qortal community, including the Qortal Development Group, cannot be held responsible for any
content published with the assistance of Q-Tube. All content published to QDN is done so by the owner of
the registered name, and no one else. The same applies to data loss, social manipulation,
any other potential issue. All responsibility lies with the user, as with every application built by
the Qortal Development Group.
</DialogContentText>
</DialogContent>
<DialogActions>
<Button

View File

@ -113,7 +113,13 @@ export default function FileElement({
service: service,
identifier: identifier,
});
filename = res?.filename || filename;
// TODO: previously this was "always" overriding the filename
// here, but i think caller filename should be honored if set.
// if there was a reason to always override, then maybe this
// should be changed back..?
if (!filename) {
filename = res?.filename || filename;
}
mimeType = res?.mimeType || mimeType;
} catch (error) {

View File

@ -170,6 +170,38 @@ export const VideoContent = () => {
const [videoData, setVideoData] = useState<any>(null);
const saveAsFilename = useMemo(() => {
// nb. we prefer to construct the local filename to use for
// saving, from the video "title" when possible
if (videoData?.title) {
// figure out filename extension
let ext = ".mp4";
if (videoData?.filename) {
// nb. this regex copied from https://stackoverflow.com/a/680982
const re = /(?:\.([^.]+))?$/;
const match = re.exec(videoData.filename);
if (match[1]) {
ext = "." + match[1];
}
}
return videoData.title + ext;
}
// otherwise use QDN filename if applicable
if (videoData?.filename) {
return videoData.filename;
}
// TODO: this was the previous value, leaving here as the
// fallback for now even though it probably is not needed..?
return videoData?.filename ||
videoData?.title?.slice(0, 20) + ".mp4";
}, [videoData]);
const hashMapVideos = useSelector(
(state: RootState) => state.video.hashMapVideos
);
@ -370,9 +402,7 @@ export const VideoContent = () => {
<FileElement
fileInfo={{
...videoReference,
filename:
videoData?.filename ||
videoData?.title?.slice(0, 20) + ".mp4",
filename: saveAsFilename,
mimeType: videoData?.videoType || '"video/mp4',
}}
title={videoData?.filename || videoData?.title?.slice(0, 20)}