Update api/funkwhale_api/playlists/utils.py

This commit is contained in:
petitminion 2021-07-15 08:58:07 +00:00
parent 7af11d3fdb
commit 91875150fb

View file

@ -1,5 +1,6 @@
import logging
import re
# /!\ The next import have xml vulnerabilities but this shouldn't have security implication in funkwhale
# since there are only used to generate xspf file.
from xml.etree.ElementTree import Element, SubElement
@ -81,7 +82,7 @@ def generate_xspf_from_playlist(playlist_id):
This returns a string containing playlist data in xspf format
"""
fw_playlist = Playlist.objects.get(id=playlist_id)
plt_tracks = fw_playlist.playlist_tracks.prefetch_related('track')
plt_tracks = fw_playlist.playlist_tracks.prefetch_related('track')
top = Element("playlist")
top.set("version", "1")
title_xspf = SubElement(top, "title")