mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 22:09:23 +02:00
resolve black
This commit is contained in:
parent
677c0274f4
commit
5f8c01c065
1 changed files with 8 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
|||
import logging
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
# /!\ 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
|
||||
|
@ -48,7 +49,9 @@ def get_track_id_from_xspf(xspf_file):
|
|||
title = track.find(".//title").text
|
||||
album = track.find(".//album").text
|
||||
except AttributeError as e:
|
||||
logger.info(f"Couldn't find the following attribute while parsing the xml file : {e!r}")
|
||||
logger.info(
|
||||
f"Couldn't find the following attribute while parsing the xml file : {e!r}"
|
||||
)
|
||||
continue
|
||||
# Finding track id in the db
|
||||
try:
|
||||
|
@ -83,9 +86,11 @@ 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")
|
||||
xspf_playlist = Element("playlist")
|
||||
xspf_tracklist = write_xspf_headers(xspf_playlist, fw_playlist.name, str(fw_playlist.creation_date))
|
||||
xspf_tracklist = write_xspf_headers(
|
||||
xspf_playlist, fw_playlist.name, str(fw_playlist.creation_date)
|
||||
)
|
||||
|
||||
for plt_track in plt_tracks:
|
||||
track = plt_track.track
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue