From dd3b385b7e80b758936f736149d348a998c345cb Mon Sep 17 00:00:00 2001 From: Rahul Raturi Date: Tue, 12 Jul 2016 23:32:48 +0530 Subject: [PATCH] Use iso_3166_1_code element for country The `country` element (used till now) is obsolete. It contains information of a single country where album is released. Instead extract all country codes from iso_3166_1_code_list element and display them. --- picard/ui/searchdialog.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/picard/ui/searchdialog.py b/picard/ui/searchdialog.py index da61e574b..2bfbd20d6 100644 --- a/picard/ui/searchdialog.py +++ b/picard/ui/searchdialog.py @@ -321,8 +321,15 @@ class TrackSearchDialog(SearchDialog): track["release"] = release.title[0].text if "date" in release.children: track["date"] = release.date[0].text - if "country" in release.children: - track["country"] = ugettext_countries(release.country[0].text) + if "release_event_list" in release.children: + country = [] + for re in release.release_event_list[0].release_event: + try: + country.append( + re.area[0].iso_3166_1_code_list[0].iso_3166_1_code[0].text) + except AttributeError: + pass + track["country"] = ", ".join(country) rg = release.release_group[0] track["rg_id"] = rg.id types_list = []