Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
e023a5cc
Commit
e023a5cc
authored
Oct 01, 2020
by
Richard Blechinger
Browse files
WIP
parent
9e4e189d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/filemanager/EditPlaylistModal.vue
View file @
e023a5cc
...
...
@@ -122,6 +122,15 @@
>
<b
class=
"upDownArrows"
>
↓
</b>
</b-button>
<b-button
v-if=
"!data.item.file"
variant=
"info"
@
click=
"editPlaylistItemDuration(data.index)"
>
Duration
</b-button>
<b-button
variant=
"danger"
@
click=
"deletePlaylistItem(data.index)"
...
...
@@ -226,8 +235,15 @@ export default {
playlistDuration
()
{
const
totalDuration
=
this
.
playlistEditor
.
entries
.
reduce
((
acc
,
entry
)
=>
{
const
file
=
this
.
getFileById
(
entry
.
file
.
id
)
return
acc
+
file
.
duration
;
const
file
=
entry
.
file
||
{}
const
{
id
}
=
file
const
savedFile
=
this
.
getFileById
(
id
)
||
{};
if
(
Number
.
isNaN
(
acc
+
savedFile
.
duration
))
{
return
acc
;
}
return
acc
+
savedFile
.
duration
;
},
0
);
return
this
.
prettyNanoseconds
(
totalDuration
)
...
...
@@ -260,6 +276,10 @@ export default {
}
},
editPlaylistItemDuration
(
index
)
{
console
.
log
(
this
.
playlistEditor
.
entries
);
},
movePlaylistItemUp
(
index
)
{
if
(
index
>
0
&&
index
<
this
.
playlistEditor
.
entries
.
length
)
{
let
temp
=
this
.
playlistEditor
.
entries
[
index
-
1
]
...
...
@@ -294,7 +314,7 @@ export default {
// add a line input to the playlist that is being edited
addPlaylistItemLine
(
line
)
{
this
.
playlistEditor
.
entries
.
push
({
uri
:
'
line://
'
+
line
})
this
.
playlistEditor
.
entries
.
push
({
uri
:
'
line://
'
+
line
+
'
?duration=9999999
'
})
},
// controls sub-modal to add a new URI to the playlist editor
...
...
src/components/filemanager/Playlists.vue
View file @
e023a5cc
...
...
@@ -72,7 +72,7 @@
This column displays the duration of all playlist entries combined
-->
<
template
v-slot:cell(duration)=
"data"
>
{{
playlistDuration
(
data
)
}}
{{
playlistDuration
(
data
)
}}
(
{{
unknownDurationCount
(
data
)
}}
unspecified)
</
template
>
<!-- Column: Last edit
...
...
@@ -189,9 +189,21 @@ export default {
},
playlistDuration
({
item
})
{
const
totalDuration
=
item
.
entries
.
reduce
((
acc
,
entry
)
=>
acc
+
entry
.
duration
,
0
)
const
totalDuration
=
item
.
entries
.
reduce
((
acc
,
entry
)
=>
{
const
newDuration
=
acc
+
entry
.
duration
;
if
(
Number
.
isNaN
(
newDuration
))
{
return
acc
;
}
return
newDuration
},
0
)
return
this
.
prettyNanoseconds
(
totalDuration
)
},
unknownDurationCount
({
item
})
{
return
item
.
entries
.
filter
(
entry
=>
!
entry
.
duration
).
length
;
}
},
}
...
...
src/mixins/prettyDate.js
View file @
e023a5cc
...
...
@@ -84,7 +84,7 @@ export default {
var
hours
=
Math
.
floor
(
sec_total
/
3600
)
var
minutes
=
Math
.
floor
((
sec_total
-
(
hours
*
3600
))
/
60
)
var
seconds
=
Math
.
floor
((
sec_total
-
(
hours
*
3600
)
-
(
minutes
*
60
))
*
10
)
/
10
return
hours
+
'
:
'
+
leadingZero
(
minutes
)
+
'
:
'
+
leadingZero
(
seconds
)
return
hours
+
'
:
'
+
leadingZero
(
minutes
)
+
'
:
'
+
leadingZero
(
seconds
.
toFixed
(
0
)
)
},
nanosecondsToMinutes
:
function
(
ns
)
{
return
ns
/
1000
/
1000
/
1000
/
60
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment