From e81afa1296e42e4ba3ff1d9bba12477c674b89b9 Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Sat, 25 Jun 2022 09:11:20 +0200 Subject: [PATCH] Add type hints --- audiorename/meta.py | 4 ++-- audiorename/musicbrainz.py | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/audiorename/meta.py b/audiorename/meta.py index d2d2d49..f724814 100644 --- a/audiorename/meta.py +++ b/audiorename/meta.py @@ -117,8 +117,8 @@ def enrich_metadata(self) -> None: break self.mb_workid = work_bottom['id'] self.work = work_bottom['title'] - wh_titles = [] - wh_ids = [] + wh_titles: List[str] = [] + wh_ids: List[str] = [] for work in work_hierarchy: wh_titles.append(work['title']) wh_ids.append(work['id']) diff --git a/audiorename/musicbrainz.py b/audiorename/musicbrainz.py index 06585e2..88964d8 100644 --- a/audiorename/musicbrainz.py +++ b/audiorename/musicbrainz.py @@ -163,14 +163,11 @@ 'title': str, }) -WorkRelation = TypedDict( - 'WorkRelation', { - 'work': WorkChild, - 'direction': Literal['backward'], - 'type': Literal['parts'] - } -) - +WorkRelation = TypedDict('WorkRelation', { + 'work': WorkChild, + 'direction': Literal['backward'], + 'type': Literal['parts'] +}) Work = TypedDict('Work', { 'id': str,