Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
minor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
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
Christian Knuchel
minor
Commits
71686f4a
Commit
71686f4a
authored
Sep 14, 2018
by
Fence
🌈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
silly tired me
parent
a836433d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
minor/controller/music.py
minor/controller/music.py
+2
-4
No files found.
minor/controller/music.py
View file @
71686f4a
...
...
@@ -19,9 +19,7 @@ class MusicController(FlaskController):
if
"song"
in
payload
:
song
=
Song
.
objects
.
get
(
id
=
payload
[
"song"
])
if
song
is
not
None
:
print
(
dir
(
song
))
filename
=
"./uploads/"
+
str
(
song
.
id
)
+
".mp3"
print
(
filename
)
if
os
.
path
.
isfile
(
filename
):
def
generate
():
with
open
(
filename
,
"rb"
)
as
fogg
:
...
...
@@ -33,7 +31,7 @@ class MusicController(FlaskController):
else
:
return
jsonify
({
"code"
:
400
,
"message"
:
"bad_request"
}),
400
#
@auth_required
@
auth_required
@
route
(
"/song/<id>"
)
def
song
(
self
,
id
,
payload
=
None
):
song
=
Song
.
objects
.
get
(
id
=
id
)
...
...
@@ -81,7 +79,7 @@ class MusicController(FlaskController):
except
KeyError
:
return
jsonify
({
"code"
:
400
,
"message"
:
"bad_request"
}),
400
#
@auth_required
@
auth_required
@
route
(
"/song/<id>/upload"
,
methods
=
[
"POST"
])
def
song_file
(
self
,
id
,
payload
=
None
):
if
'file'
in
request
.
files
:
...
...
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