mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 20:12:33 +01:00
Add some typings
This commit is contained in:
parent
1950a98da8
commit
7f5a28348c
2 changed files with 5 additions and 3 deletions
|
|
@ -14,7 +14,9 @@
|
|||
|
||||
"""Facilities for automatically determining files' correct metadata.
|
||||
"""
|
||||
from typing import Mapping
|
||||
|
||||
from beets.library import Item
|
||||
|
||||
from beets import logging
|
||||
from beets import config
|
||||
|
|
@ -71,7 +73,7 @@ SPECIAL_FIELDS = {
|
|||
|
||||
# Additional utilities for the main interface.
|
||||
|
||||
def apply_item_metadata(item, track_info):
|
||||
def apply_item_metadata(item: Item, track_info: TrackInfo):
|
||||
"""Set an item's metadata from its matched TrackInfo object.
|
||||
"""
|
||||
item.artist = track_info.artist
|
||||
|
|
@ -95,7 +97,7 @@ def apply_item_metadata(item, track_info):
|
|||
# and track number). Perhaps these should be emptied?
|
||||
|
||||
|
||||
def apply_metadata(album_info, mapping):
|
||||
def apply_metadata(album_info: AlbumInfo, mapping: Mapping[Item, TrackInfo]):
|
||||
"""Set the items' metadata to match an AlbumInfo object using a
|
||||
mapping from Items to TrackInfo objects.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class AttrDict(dict):
|
|||
def __setattr__(self, key, value):
|
||||
self.__setitem__(key, value)
|
||||
|
||||
def __hash__(self):
|
||||
def __hash__(self) -> int:
|
||||
return id(self)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue