Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Taiko Web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Taiko Web
Commits
1aecc7d5
Commit
1aecc7d5
authored
Feb 21, 2019
by
LoveEevee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongSelect: Use seconds for previews
parent
3a28d967
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
app.py
app.py
+1
-1
public/src/js/importsongs.js
public/src/js/importsongs.js
+2
-2
public/src/js/songselect.js
public/src/js/songselect.js
+2
-2
No files found.
app.py
View file @
1aecc7d5
...
@@ -160,7 +160,7 @@ def make_preview(song_id, song_type, preview):
...
@@ -160,7 +160,7 @@ def make_preview(song_id, song_type, preview):
prev_path
=
'public/songs/
%
s/preview.mp3'
%
song_id
prev_path
=
'public/songs/
%
s/preview.mp3'
%
song_id
if
os
.
path
.
isfile
(
song_path
)
and
not
os
.
path
.
isfile
(
prev_path
):
if
os
.
path
.
isfile
(
song_path
)
and
not
os
.
path
.
isfile
(
prev_path
):
if
not
preview
or
preview
<=
0
.1
:
if
not
preview
or
preview
<=
0
:
print
(
'Skipping #
%
s due to no preview'
%
song_id
)
print
(
'Skipping #
%
s due to no preview'
%
song_id
)
return
False
return
False
...
...
public/src/js/importsongs.js
View file @
1aecc7d5
...
@@ -197,7 +197,7 @@
...
@@ -197,7 +197,7 @@
subtitle
=
subtitle
.
slice
(
2
)
subtitle
=
subtitle
.
slice
(
2
)
}
}
songObj
.
subtitle
=
songObj
.
subtitle_en
=
subtitle
songObj
.
subtitle
=
songObj
.
subtitle_en
=
subtitle
songObj
.
preview
=
meta
.
demostart
?
Math
.
floor
(
meta
.
demostart
*
1000
)
:
0
songObj
.
preview
=
meta
.
demostart
||
0
if
(
meta
.
level
){
if
(
meta
.
level
){
songObj
.
stars
[
this
.
courseTypes
[
diff
]]
=
meta
.
level
+
(
meta
.
branch
?
"
B
"
:
""
)
songObj
.
stars
[
this
.
courseTypes
[
diff
]]
=
meta
.
level
+
(
meta
.
branch
?
"
B
"
:
""
)
}
}
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
chart
:
data
,
chart
:
data
,
subtitle
:
osu
.
metadata
.
ArtistUnicode
||
osu
.
metadata
.
Artist
,
subtitle
:
osu
.
metadata
.
ArtistUnicode
||
osu
.
metadata
.
Artist
,
subtitle_en
:
osu
.
metadata
.
Artist
||
osu
.
metadata
.
ArtistUnicode
,
subtitle_en
:
osu
.
metadata
.
Artist
||
osu
.
metadata
.
ArtistUnicode
,
preview
:
osu
.
generalInfo
.
PreviewTime
,
preview
:
osu
.
generalInfo
.
PreviewTime
/
1000
,
stars
:
[
null
,
null
,
null
,
parseInt
(
osu
.
difficulty
.
overallDifficulty
)
||
1
],
stars
:
[
null
,
null
,
null
,
parseInt
(
osu
.
difficulty
.
overallDifficulty
)
||
1
],
music
:
this
.
otherFiles
[
dir
+
osu
.
generalInfo
.
AudioFilename
.
toLowerCase
()]
music
:
this
.
otherFiles
[
dir
+
osu
.
generalInfo
.
AudioFilename
.
toLowerCase
()]
}
}
...
...
public/src/js/songselect.js
View file @
1aecc7d5
...
@@ -1746,7 +1746,7 @@ class SongSelect{
...
@@ -1746,7 +1746,7 @@ class SongSelect{
}
else
{
}
else
{
songObj
=
{
id
:
id
}
songObj
=
{
id
:
id
}
var
previewFilename
=
prvTime
>
0
.1
?
"
/preview.mp3
"
:
"
/main.mp3
"
var
previewFilename
=
prvTime
>
0
?
"
/preview.mp3
"
:
"
/main.mp3
"
var
loadPreview
=
previewFilename
=>
{
var
loadPreview
=
previewFilename
=>
{
return
snd
.
previewGain
.
load
(
gameConfig
.
songs_baseurl
+
id
+
previewFilename
)
return
snd
.
previewGain
.
load
(
gameConfig
.
songs_baseurl
+
id
+
previewFilename
)
...
@@ -1786,7 +1786,7 @@ class SongSelect{
...
@@ -1786,7 +1786,7 @@ class SongSelect{
var
difference
=
endLoad
-
startLoad
var
difference
=
endLoad
-
startLoad
var
minDelay
=
300
var
minDelay
=
300
var
delay
=
minDelay
-
Math
.
min
(
minDelay
,
difference
)
var
delay
=
minDelay
-
Math
.
min
(
minDelay
,
difference
)
this
.
preview
.
playLoop
(
delay
/
1000
,
false
,
prvTime
/
1000
)
this
.
preview
.
playLoop
(
delay
/
1000
,
false
,
prvTime
)
}
}
endPreview
(){
endPreview
(){
this
.
previewId
++
this
.
previewId
++
...
...
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