Merge pull request #4412 from beetbox/album-items

Document Album.items() / LibModel.items() conflict
This commit is contained in:
Adrian Sampson 2022-08-21 07:09:12 -07:00 committed by GitHub
commit 6e0f7a1e68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -1145,6 +1145,11 @@ class Album(LibModel):
def items(self):
"""Return an iterable over the items associated with this
album.
This method conflicts with :meth:`LibModel.items`, which is
inherited from :meth:`beets.dbcore.Model.items`.
Since :meth:`Album.items` predates these methods, and is
likely to be used by plugins, we keep this interface as-is.
"""
return self._db.items(dbcore.MatchQuery('album_id', self.id))

View file

@ -99,6 +99,10 @@ synchronized (via load or store) with the database.
.. automethod:: items
.. note::
The :py:meth:`Album.items` method is not inherited from
:py:meth:`LibModel.items` for historical reasons.
.. automethod:: get
Item
@ -207,6 +211,8 @@ metadata field.
.. automethod:: item_dir
.. automethod:: items
Albums extend the normal model interface to also forward changes to their
items: