mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 12:39:48 +02:00
Update api/funkwhale_api/playlists/utils.py
This commit is contained in:
parent
7af11d3fdb
commit
91875150fb
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
|
|
||||||
# /!\ The next import have xml vulnerabilities but this shouldn't have security implication in funkwhale
|
# /!\ The next import have xml vulnerabilities but this shouldn't have security implication in funkwhale
|
||||||
# since there are only used to generate xspf file.
|
# since there are only used to generate xspf file.
|
||||||
from xml.etree.ElementTree import Element, SubElement
|
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
|
This returns a string containing playlist data in xspf format
|
||||||
"""
|
"""
|
||||||
fw_playlist = Playlist.objects.get(id=playlist_id)
|
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 = Element("playlist")
|
||||||
top.set("version", "1")
|
top.set("version", "1")
|
||||||
title_xspf = SubElement(top, "title")
|
title_xspf = SubElement(top, "title")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue