Commit d2ec3cce authored by Agate's avatar Agate 💬
Browse files

Merge branch '1250-rss-w3c' into 'develop'

Resolve "The feed does not pass w3c validation"

Closes #1250

See merge request funkwhale/funkwhale!1229
parents 4252ae34 3a83290c
......@@ -818,7 +818,7 @@ def rss_serialize_item(upload):
data = {
"title": [{"value": upload.track.title}],
"itunes:title": [{"value": upload.track.title}],
"guid": [{"cdata_value": str(upload.uuid), "isPermalink": "false"}],
"guid": [{"cdata_value": str(upload.uuid), "isPermaLink": "false"}],
"pubDate": [{"value": rfc822_date(upload.creation_date)}],
"itunes:duration": [{"value": rss_duration(upload.duration)}],
"itunes:explicit": [{"value": "no"}],
......@@ -841,7 +841,7 @@ def rss_serialize_item(upload):
],
}
if upload.track.description:
data["itunes:subtitle"] = [{"value": upload.track.description.truncate(255)}]
data["itunes:subtitle"] = [{"value": upload.track.description.truncate(254)}]
data["itunes:summary"] = [{"cdata_value": upload.track.description.rendered}]
data["description"] = [{"value": upload.track.description.as_plain_text}]
......@@ -853,7 +853,7 @@ def rss_serialize_item(upload):
tagged_items = getattr(upload.track, "_prefetched_tagged_items", [])
if tagged_items:
data["itunes:keywords"] = [
{"value": " ".join([ti.tag.name for ti in tagged_items])}
{"value": ",".join([ti.tag.name for ti in tagged_items])}
]
return data
......@@ -903,7 +903,7 @@ def rss_serialize_channel(channel):
data["itunes:category"] = [node]
if channel.artist.description:
data["itunes:subtitle"] = [{"value": channel.artist.description.truncate(255)}]
data["itunes:subtitle"] = [{"value": channel.artist.description.truncate(254)}]
data["itunes:summary"] = [{"cdata_value": channel.artist.description.rendered}]
data["description"] = [{"value": channel.artist.description.as_plain_text}]
......
......@@ -26,6 +26,9 @@ class FunkwhaleAccountAdapter(DefaultAccountAdapter):
def get_login_redirect_url(self, request):
return "noop"
def get_signup_redirect_url(self, request):
return "noop"
def add_message(self, *args, **kwargs):
# disable message sending
return
......@@ -6,7 +6,7 @@ django-environ~=0.4
# Images
Pillow~=7.0
django-allauth~=0.42
django-allauth~=0.42.0
psycopg2-binary~=2.8
......
......@@ -300,13 +300,13 @@ def test_rss_item_serializer(factories):
expected = {
"title": [{"value": upload.track.title}],
"itunes:title": [{"value": upload.track.title}],
"itunes:subtitle": [{"value": description.truncate(255)}],
"itunes:subtitle": [{"value": description.truncate(254)}],
"itunes:summary": [{"cdata_value": description.rendered}],
"description": [{"value": description.as_plain_text}],
"guid": [{"cdata_value": str(upload.uuid), "isPermalink": "false"}],
"guid": [{"cdata_value": str(upload.uuid), "isPermaLink": "false"}],
"pubDate": [{"value": serializers.rfc822_date(upload.creation_date)}],
"itunes:duration": [{"value": serializers.rss_duration(upload.duration)}],
"itunes:keywords": [{"value": "pop rock"}],
"itunes:keywords": [{"value": "pop,rock"}],
"itunes:explicit": [{"value": "no"}],
"itunes:episodeType": [{"value": "full"}],
"itunes:season": [{"value": upload.track.disc_number}],
......
Make the generated RSS feed more conformant with w3c specification (#1250)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment