Describe the bug
get_track does no checks to ensure the track exists (in the XML file), so if the track cannot be found, an error with an unclear explanation will be thrown
To Reproduce
Steps to reproduce the behavior:
from pyrekordbox.rbxml import RekordboxXml
xml = RekordboxXml()
xml.get_track(Location="/does/not/exist")
...
The resulting error is:
TypeError: SubElement() argument 1 must be xml.etree.ElementTree.Element, not None
Expected behavior
Probably should just return None if there's no track found, or raise an error. The following inserted here should fix it:
return None if el is None else Track(element=el)
Environment
- Pyrekordbox version:
0.4.4
- Rekordbox version: N/A (not installed on my current computer)
Describe the bug
get_trackdoes no checks to ensure the track exists (in the XML file), so if the track cannot be found, an error with an unclear explanation will be thrownTo Reproduce
Steps to reproduce the behavior:
The resulting error is:
Expected behavior
Probably should just return
Noneif there's no track found, or raise an error. The following inserted here should fix it:Environment
0.4.4