Fetching parentwork if changed, even if not force
@@ -173,13 +173,17 @@ add one at https://musicbrainz.org/recording/{}', item, item.mb_trackid)
return
hasparent = hasattr(item, 'parentwork')
- if force or not hasparent:
+ workfalse = True
+ if hasattr(item, 'mb_workid_current'):
+ workfalse = item.mb_workid_current != item.mb_workid
+ if force or (not hasparent) or workfalse:
try:
work_info, work_date = find_parentwork_info(item.mb_workid)
except musicbrainzngs.musicbrainz.WebServiceError as e:
self._log.debug("error fetching work: {}", e)
return
parent_info = self.get_info(item, work_info)
+ parent_info['mb_workid_current'] = item.mb_workid
if 'parent_composer' in parent_info:
self._log.debug("Work fetched: {} - {}",
parent_info['parentwork'],
@@ -202,4 +206,5 @@ add one at https://musicbrainz.org/recording/{}', item, item.mb_trackid)
return ui.show_model_changes(
item, fields=['parentwork', 'parentwork_disambig',
'mb_parentworkid', 'parent_composer',
- 'parent_composer_sort', 'work_date'])
+ 'parent_composer_sort', 'work_date',
+ 'mb_workid_current'])
