Some local lobrary extensions may benefit from having direct access to the data dictionary returned by mopidy.audio.scan.Scanner.scan
. For example. Mopidy-Local-SQLite
provides support for extracting album art for local media files, but has to re-scan every file to do so. I therefore propose changing the method signature of
mopidy.local.Library.add(track)
to
mopidy.local.Library.add(track, data=None)
The optional data
argument would be the result from Scanner.scan()
. Local library extensions (LLEs) would be free to use or ignore that additional data. As @adamcik pointed out [Local Library Limitations], there currently aren’t that many, so making this backwards-incompatible change is probably safe for now. This would also give LLEs proper access to a file URI for the media file, whereas now they have to extract that from the local track URI by reverse-engineering (AFAICS). LLEs could also be given appropriate time to change their method signature until Mopidy core actually passes a second argument to the Library.add()
function (v0.20?).