Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Baptiste Benti
funkwhale
Commits
d33d0849
Commit
d33d0849
authored
Jul 11, 2020
by
Agate
💬
Browse files
Fixed #1171: invalid swagger syntax
parent
389a30a1
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
api/funkwhale_api/audio/serializers.py
View file @
d33d0849
...
...
@@ -824,7 +824,9 @@ def rss_serialize_item(upload):
"enclosure"
:
[
{
# we enforce MP3, since it's the only format supported everywhere
"url"
:
federation_utils
.
full_url
(
upload
.
get_listen_url
(
to
=
"mp3"
)),
"url"
:
federation_utils
.
full_url
(
upload
.
get_listen_url
(
to
=
"mp3"
,
download
=
False
)
),
"length"
:
upload
.
size
or
0
,
"type"
:
"audio/mpeg"
,
}
...
...
api/funkwhale_api/music/models.py
View file @
d33d0849
...
...
@@ -899,10 +899,12 @@ class Upload(models.Model):
def
listen_url
(
self
):
return
self
.
track
.
listen_url
+
"?upload={}"
.
format
(
self
.
uuid
)
def
get_listen_url
(
self
,
to
=
None
):
def
get_listen_url
(
self
,
to
=
None
,
download
=
None
):
url
=
self
.
listen_url
if
to
:
url
+=
"&to={}"
.
format
(
to
)
if
download
is
not
None
:
url
+=
"&download={}"
.
format
(
str
(
download
).
lower
())
return
url
@
property
...
...
api/tests/audio/test_serializers.py
View file @
d33d0849
...
...
@@ -312,7 +312,9 @@ def test_rss_item_serializer(factories):
"link"
:
[{
"value"
:
federation_utils
.
full_url
(
upload
.
track
.
get_absolute_url
())}],
"enclosure"
:
[
{
"url"
:
federation_utils
.
full_url
(
upload
.
get_listen_url
(
"mp3"
)),
"url"
:
federation_utils
.
full_url
(
upload
.
get_listen_url
(
"mp3"
,
download
=
False
)
),
"length"
:
upload
.
size
,
"type"
:
"audio/mpeg"
,
}
...
...
changes/changelog.d/1121.bugfix
0 → 100644
View file @
d33d0849
Ensure compatibility with Apple Podcasts (#1176)
\ No newline at end of file
docs/swagger.yml
View file @
d33d0849
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment