Hello,
I am currently working on a plugin for Beets.
I am attempting to access metadata of a file that is stored within the Beets library based on the path of the file. In short, I have a list of file paths that correspond to music files, and I want to grab metadata for each music file. I am currently trying to use the method beets.library.Library.items()
, but I was unable to figure out how to create a query that works. I tried passing in a string like this: "path:C:\Users\beansman\Music\song1.mp3"
, but that didn’t work.
I also tried using AndQuery.from_strings
which is recommended here: https://beets.readthedocs.io/en/stable/dev/library.html#queries
The section states the following:
Beets has a human-writable plain-text query syntax that can be parsed into
Query
objects. CallingAndQuery.from_strings
parses a list of query parts into a query object that can then be used withLibrary
objects.
I was unable to find that method in the source code of Beets, with the closest method beingbeets.dbcore.queryparse.query_from_strings
.
Am I missing something simple? I just want to be able to specify a path, get Item objects that are at the path, and then grab other metadata using the Item objects.