|
14 | 14 |
|
15 | 15 | """Facilities for automatically determining files' correct metadata."""
|
16 | 16 |
|
17 |
| -from collections.abc import Mapping, Sequence |
18 |
| -from typing import Union |
| 17 | +from __future__ import annotations |
| 18 | + |
| 19 | +from typing import TYPE_CHECKING, Union |
19 | 20 |
|
20 | 21 | from beets import config, logging
|
21 |
| -from beets.library import Album, Item, LibModel |
| 22 | +from beets.util import get_most_common_tags as current_metadata |
22 | 23 |
|
23 | 24 | # Parts of external interface.
|
24 | 25 | from beets.util import unique_list
|
25 | 26 |
|
26 |
| -from .hooks import AlbumInfo, AlbumMatch, Distance, TrackInfo, TrackMatch |
27 |
| -from .match import ( |
28 |
| - Proposal, |
29 |
| - Recommendation, |
30 |
| - current_metadata, |
31 |
| - tag_album, |
32 |
| - tag_item, |
33 |
| -) |
| 27 | +from .distance import Distance |
| 28 | +from .hooks import AlbumInfo, AlbumMatch, TrackInfo, TrackMatch |
| 29 | +from .match import Proposal, Recommendation, tag_album, tag_item |
| 30 | + |
| 31 | +if TYPE_CHECKING: |
| 32 | + from collections.abc import Mapping, Sequence |
| 33 | + |
| 34 | + from beets.library import Album, Item, LibModel |
34 | 35 |
|
35 | 36 | __all__ = [
|
36 | 37 | "AlbumInfo",
|
37 | 38 | "AlbumMatch",
|
38 |
| - "Distance", |
39 |
| - "TrackInfo", |
40 |
| - "TrackMatch", |
| 39 | + "Distance", # for backwards compatibility |
41 | 40 | "Proposal",
|
42 | 41 | "Recommendation",
|
| 42 | + "TrackInfo", |
| 43 | + "TrackMatch", |
43 | 44 | "apply_album_metadata",
|
44 | 45 | "apply_item_metadata",
|
45 | 46 | "apply_metadata",
|
46 |
| - "current_metadata", |
| 47 | + "current_metadata", # for backwards compatibility |
47 | 48 | "tag_album",
|
48 | 49 | "tag_item",
|
49 | 50 | ]
|
|
0 commit comments