Skip to content

Commit

Permalink
Merge pull request beetbox#4412 from beetbox/album-items
Browse files Browse the repository at this point in the history
Document Album.items() / LibModel.items() conflict
  • Loading branch information
sampsyo authored Aug 21, 2022
2 parents f0a6bbb + bf8fbed commit 6e0f7a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions beets/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,11 @@ def _getters(cls):
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))

Expand Down
6 changes: 6 additions & 0 deletions docs/dev/library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -207,6 +211,8 @@ metadata field.

.. automethod:: item_dir

.. automethod:: items

Albums extend the normal model interface to also forward changes to their
items:

Expand Down

0 comments on commit 6e0f7a1

Please sign in to comment.