From 8df2e5b8f5affc9a5472886e819a31789c8fa280 Mon Sep 17 00:00:00 2001 From: soergeld Date: Mon, 27 Apr 2020 12:01:35 +0200 Subject: [PATCH] arrange decoder --- beets/autotag/hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py index 48d1cae52..95533d11d 100644 --- a/beets/autotag/hooks.py +++ b/beets/autotag/hooks.py @@ -162,7 +162,7 @@ class AlbumInfo(Map): 'media', 'discogs_albumid', 'discogs_labelid', 'discogs_artistid']: value = getattr(self, fld) - if type(value) == str: + if isinstance(value, bytes): if isinstance(value, bytes): setattr(self, fld, value.decode(codec, 'ignore')) @@ -225,7 +225,7 @@ class TrackInfo(Map): for fld in ['title', 'artist', 'medium', 'artist_sort', 'disctitle', 'artist_credit', 'media']: value = getattr(self, fld) - if type(value) == str: + if isinstance(value, bytes): if isinstance(value, bytes): setattr(self, fld, value.decode(codec, 'ignore'))