7878 attrgetter_cache , deprint , dict_sort , fast_cached_property , \
7979 forward_compat_path_to_fn , round_size , str_to_sig , to_unix_newlines , \
8080 to_win_newlines , top_level_files
81- from ..bosh import ModInfo , omods , DataStore , diff_tags , read_loot_tags , \
82- read_dir_tags , save_tags_to_dir
81+ from ..bosh import ModInfo , omods , DataStore , read_loot_tags , read_dir_tags , \
82+ save_tags_to_dir
8383from ..exception import BoltError , CancelError , SkipError , UnknownListener
8484from ..gui import CENTER , BusyCursor , Button , CancelButton , CenteredSplash , \
8585 CheckListBox , Color , CopyOrMovePopup , DateAndTimeDialog , DropDown , \
@@ -1656,14 +1656,6 @@ def Execute(self):
16561656 _mod_details ._refresh_tags ()
16571657 # Copy tags to various places
16581658 bashTagsDesc = mod_info .getBashTagsDesc ()
1659- # We need to grab both the ones from the description and from LOOT,
1660- # since we need to save a diff in case of Copy to BashTags
1661- added_tags , deleted_tags = read_loot_tags (mod_info )
1662- # Emulate the effects of applying the LOOT tags
1663- old_tags = bashTagsDesc .copy ()
1664- old_tags |= added_tags
1665- old_tags -= deleted_tags
1666- dir_diff = diff_tags (mod_tags , old_tags )
16671659 class Tags_CopyTagList (AppendableLink , ItemLink ):
16681660 _text = _ ('Copy Tag List' )
16691661 _help = _ ('Copies a list of all bash tags for this game to the '
@@ -1681,10 +1673,16 @@ class Tags_CopyToBashTags(EnabledLink):
16811673 'description/LOOT tags to %(bashtags_path)s.' ) % {
16821674 'bashtags_path' : mod_info .tags_path ()}
16831675 def _enable (self ):
1684- return (not mod_info .mod_auto_bash_tags and
1685- read_dir_tags (mod_info ) != dir_diff )
1676+ if mod_info .mod_auto_bash_tags : return False
1677+ # We need to grab both the ones from the description and from
1678+ # LOOT, to calculate the diff with automatic tags
1679+ added_tags , deleted_tags = read_loot_tags (mod_info )
1680+ # Emulate the effects of applying the LOOT tags
1681+ auto_tags = (bashTagsDesc | added_tags ) - deleted_tags
1682+ self ._add_rem = mod_tags - auto_tags , auto_tags - mod_tags
1683+ return read_dir_tags (mod_info ) != self ._add_rem
16861684 def Execute (self ):
1687- save_tags_to_dir (mod_info , dir_diff )
1685+ save_tags_to_dir (mod_info , self . _add_rem )
16881686 class Tags_CopyToDescription (EnabledLink ):
16891687 """Copy manually assigned bash tags into the mod description"""
16901688 _text = _ ('Copy to Description' )
0 commit comments