Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
frontend
Commits
c1715197
Commit
c1715197
authored
3 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Show download status after finished downloading and fix download links
parent
e2b372a0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#7541
failed
3 months ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/videoag/course/DownloadManager.tsx
+2
-7
2 additions, 7 deletions
src/videoag/course/DownloadManager.tsx
src/videoag/course/Medium.tsx
+2
-2
2 additions, 2 deletions
src/videoag/course/Medium.tsx
with
4 additions
and
9 deletions
src/videoag/course/DownloadManager.tsx
+
2
−
7
View file @
c1715197
...
@@ -181,7 +181,7 @@ async function downloadWithDownloadAPI(
...
@@ -181,7 +181,7 @@ async function downloadWithDownloadAPI(
):
Promise
<
boolean
>
{
):
Promise
<
boolean
>
{
showWarningToast
(
showWarningToast
(
"
Unable to store files in directory automatically. Using basic download API which might require
"
+
"
Unable to store files in directory automatically. Using basic download API which might require
"
+
"
you to select
ed
the destination location for every file.
"
,
"
you to select the destination location for every file.
"
,
);
);
for
(
const
toDownload
of
filesToDownload
)
{
for
(
const
toDownload
of
filesToDownload
)
{
try
{
try
{
...
@@ -211,7 +211,6 @@ async function downloadWithDownloadAPI(
...
@@ -211,7 +211,6 @@ async function downloadWithDownloadAPI(
}
}
async
function
downloadMedia
(
async
function
downloadMedia
(
downloadStatus
:
Map
<
int
,
DownloadStatus
>
|
undefined
,
setDownloadStatus
:
(
setDownloadStatus
:
(
fn
:
(
old
?:
Map
<
int
,
DownloadStatus
>
|
undefined
)
=>
Map
<
int
,
DownloadStatus
>
|
undefined
,
fn
:
(
old
?:
Map
<
int
,
DownloadStatus
>
|
undefined
)
=>
Map
<
int
,
DownloadStatus
>
|
undefined
,
)
=>
void
,
)
=>
void
,
...
@@ -287,9 +286,6 @@ async function downloadMedia(
...
@@ -287,9 +286,6 @@ async function downloadMedia(
return
false
;
return
false
;
});
});
console
.
log
(
`Download finished. Success:
${
success
}
`
);
console
.
log
(
`Download finished. Success:
${
success
}
`
);
if
(
success
)
{
showInfoToast
(
"
Download finished
"
);
}
}
}
function
DownloadAllLectureListItem
({
function
DownloadAllLectureListItem
({
...
@@ -310,7 +306,7 @@ function DownloadAllLectureListItem({
...
@@ -310,7 +306,7 @@ function DownloadAllLectureListItem({
const
media
=
getSortedDownloadablePublishMedia
(
lecture
.
publish_media
!
);
const
media
=
getSortedDownloadablePublishMedia
(
lecture
.
publish_media
!
);
let
displayedProgress
;
let
displayedProgress
;
if
(
isDownloading
&&
selectedMediumId
!==
undefined
)
{
if
(
(
isDownloading
||
downloadStatus
!==
undefined
)
&&
selectedMediumId
!==
undefined
)
{
// Lecture needs to be downloaded
// Lecture needs to be downloaded
if
(
downloadStatus
===
undefined
)
{
if
(
downloadStatus
===
undefined
)
{
// Not yet started
// Not yet started
...
@@ -495,7 +491,6 @@ export default function DownloadAllModal({ course }: { course: course }) {
...
@@ -495,7 +491,6 @@ export default function DownloadAllModal({ course }: { course: course }) {
const
startDownloads
=
async
()
=>
{
const
startDownloads
=
async
()
=>
{
if
(
isDownloading
)
return
;
if
(
isDownloading
)
return
;
downloadMedia
(
downloadMedia
(
downloadStatus
,
setDownloadStatus
,
setDownloadStatus
,
course
,
course
,
chosenMediumIdByLectureId
,
chosenMediumIdByLectureId
,
...
...
This diff is collapsed.
Click to expand it.
src/videoag/course/Medium.tsx
+
2
−
2
View file @
c1715197
...
@@ -87,7 +87,7 @@ export function PublishMediumList({ publish_media }: { publish_media: publish_me
...
@@ -87,7 +87,7 @@ export function PublishMediumList({ publish_media }: { publish_media: publish_me
}
}
>
>
<
span
className
=
"bi bi-download"
/>
<
span
className
=
"bi bi-download"
/>
<
a
href
=
{
medium
.
download_url
}
className
=
"mx-1"
>
<
a
href
=
{
medium
.
download_url
}
download
target
=
"_blank"
className
=
"mx-1"
>
{
name
}
{
name
}
</
a
>
</
a
>
{
editMode
&&
(
{
editMode
&&
(
...
@@ -147,7 +147,7 @@ export function PublishMediumDownloadButton({
...
@@ -147,7 +147,7 @@ export function PublishMediumDownloadButton({
return
(
return
(
<
div
key
=
{
medium
.
id
}
className
=
{
"
d-flex align-items-center
"
+
bgColor
}
>
<
div
key
=
{
medium
.
id
}
className
=
{
"
d-flex align-items-center
"
+
bgColor
}
>
<
Dropdown
.
Item
href
=
{
medium
.
download_url
}
download
>
<
Dropdown
.
Item
href
=
{
medium
.
download_url
}
download
target
=
"_blank"
>
{
name
}
{
name
}
</
Dropdown
.
Item
>
</
Dropdown
.
Item
>
{
editMode
&&
(
{
editMode
&&
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment