# Read xspf playlist file to get all its tracks.
def _loadTracksFromXspf(self, filePath: str, playlist: LibraryPlaylist) -> None:
xspf: xml.etree.ElementTree.Element = xml.etree.ElementTree.parse(filePath).getroot()
- xmlns: str = "http://xspf.org/ns/0/"
+ xmlns: str = "{http://xspf.org/ns/0/}"
for node in xspf: # <trackList> in document.
- if not node.tag.endswith("trackList"):
+ if not node.tag == xmlns + "trackList":
continue
for track in node: # <track> in <trackList>.
- if not track.tag.endswith("track"):
+ if not track.tag == xmlns + "track":
continue
- element: xml.etree.ElementTree.Element | None = track.find("{" + xmlns + "}location")
+ element: xml.etree.ElementTree.Element | None = track.find(xmlns + "location")
if element is None:
continue