Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
03619dd7
Commit
03619dd7
authored
6 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
fixed progress reporting
parent
4e1ef17f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
importer/fetch.go
+3
-0
3 additions, 0 deletions
importer/fetch.go
importer/normalize.go
+1
-1
1 addition, 1 deletion
importer/normalize.go
importer/normalize_converter.go
+2
-0
2 additions, 0 deletions
importer/normalize_converter.go
importer/types.go
+6
-0
6 additions, 0 deletions
importer/types.go
with
12 additions
and
1 deletion
importer/fetch.go
+
3
−
0
View file @
03619dd7
...
@@ -129,6 +129,9 @@ func (job *Job) fetch() (interface{}, error) {
...
@@ -129,6 +129,9 @@ func (job *Job) fetch() (interface{}, error) {
err
=
res
.
err
err
=
res
.
err
}
}
for
_
,
l
:=
range
convLog
{
job
.
im
.
dbgLog
.
Println
(
l
.
Line
)
}
job
.
Progress
.
set
(
StepFetching
,
1
)
job
.
Progress
.
set
(
StepFetching
,
1
)
job
.
source
.
done
<-
&
JobSourceResult
{
err
,
res
.
hash
,
convLog
}
job
.
source
.
done
<-
&
JobSourceResult
{
err
,
res
.
hash
,
convLog
}
return
loudness
,
err
return
loudness
,
err
...
...
This diff is collapsed.
Click to expand it.
importer/normalize.go
+
1
−
1
View file @
03619dd7
...
@@ -55,7 +55,7 @@ func (job *Job) normalize(loudness interface{}) error {
...
@@ -55,7 +55,7 @@ func (job *Job) normalize(loudness interface{}) error {
return
return
}
}
written
,
err
:=
io
.
Copy
(
&
progressWriter
{
job
,
StepNormalizing
,
0
,
uint64
(
srcStat
.
Size
()),
conv
},
src
)
written
,
err
:=
io
.
Copy
(
&
progressWriter
{
job
,
StepNormalizing
,
uint64
(
srcStat
.
Size
()),
0
,
conv
},
src
)
if
err
!=
nil
{
if
err
!=
nil
{
done
<-
err
done
<-
err
return
return
...
...
This diff is collapsed.
Click to expand it.
importer/normalize_converter.go
+
2
−
0
View file @
03619dd7
...
@@ -40,6 +40,8 @@ type normalizeConverter interface {
...
@@ -40,6 +40,8 @@ type normalizeConverter interface {
func
(
job
*
Job
)
newNormalizeConverter
(
loudness
interface
{})
(
normalizeConverter
,
error
)
{
func
(
job
*
Job
)
newNormalizeConverter
(
loudness
interface
{})
(
normalizeConverter
,
error
)
{
if
loudness
==
nil
{
if
loudness
==
nil
{
// make default converter configurable?
// make default converter configurable?
// mind that there is no nullNormalizeConverter because we need something to
// convert incoming files to the format the store uses.
return
newFFmpegNormalizeConverter
(
job
,
nil
)
return
newFFmpegNormalizeConverter
(
job
,
nil
)
}
}
...
...
This diff is collapsed.
Click to expand it.
importer/types.go
+
6
−
0
View file @
03619dd7
...
@@ -203,6 +203,12 @@ func (p *JobProgress) get() (step JobProgressStep, progress float32) {
...
@@ -203,6 +203,12 @@ func (p *JobProgress) get() (step JobProgressStep, progress float32) {
func
(
p
*
JobProgress
)
MarshalJSON
()
([]
byte
,
error
)
{
func
(
p
*
JobProgress
)
MarshalJSON
()
([]
byte
,
error
)
{
step
,
progress
:=
p
.
get
()
step
,
progress
:=
p
.
get
()
if
math
.
IsNaN
(
float64
(
progress
))
||
math
.
IsInf
(
float64
(
progress
),
0
)
||
progress
<
0.0
{
progress
=
-
1.0
}
else
if
progress
>
1.0
{
progress
=
1.0
}
return
json
.
Marshal
(
struct
{
return
json
.
Marshal
(
struct
{
Step
JobProgressStep
`json:"step"`
Step
JobProgressStep
`json:"step"`
Progress
float32
`json:"progress"`
Progress
float32
`json:"progress"`
...
...
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