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
592e54dc
Commit
592e54dc
authored
Oct 18, 2018
by
Bui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust ffmpeg command, remove startup preview checks
parent
cb8b8b4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
app.py
app.py
+4
-12
No files found.
app.py
View file @
592e54dc
...
...
@@ -167,6 +167,9 @@ def make_preview(song_id, song_type):
song_path
=
'public/songs/
%
s/main.mp3'
%
song_id
prev_path
=
'public/songs/
%
s/preview.mp3'
%
song_id
if
os
.
path
.
isfile
(
prev_path
):
os
.
remove
(
prev_path
)
if
os
.
path
.
isfile
(
song_path
)
and
not
os
.
path
.
isfile
(
prev_path
):
preview
=
get_preview
(
song_id
,
song_type
)
/
1000
if
not
preview
or
preview
<=
0.1
:
...
...
@@ -175,22 +178,11 @@ def make_preview(song_id, song_type):
print
'Making preview.mp3 for song #
%
s'
%
song_id
ff
=
FFmpeg
(
inputs
=
{
song_path
:
'-ss
%
s'
%
preview
},
outputs
=
{
prev_path
:
'-codec:a libmp3lame -
b:a 128
k -y -loglevel panic'
})
outputs
=
{
prev_path
:
'-codec:a libmp3lame -
ar 32000 -b:a 92
k -y -loglevel panic'
})
ff
.
run
()
return
prev_path
def
check_song_previews
():
with
app
.
app_context
():
songs
=
query_db
(
'select * from songs where enabled = 1'
)
for
song
in
songs
:
make_preview
(
song
[
0
],
song
[
10
])
check_song_previews
()
if
__name__
==
'__main__'
:
app
.
run
(
port
=
34801
)
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