Skip to content
Snippets Groups Projects
Commit d33d0849 authored by Agate's avatar Agate 💬
Browse files

Fixed #1171: invalid swagger syntax

parent 389a30a1
No related branches found
No related tags found
No related merge requests found
......@@ -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",
}
......
......@@ -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
......
......@@ -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",
}
......
Ensure compatibility with Apple Podcasts (#1176)
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment