fix placeholder music data replacing existing music

pull/1/head
qwewqa 4 years ago
parent 90e38fce99
commit bc89624ad3
  1. 3
      miyu_bot/commands/cogs/music.py
  2. 3
      miyu_bot/commands/common/fuzzy_matching.py

@ -21,7 +21,8 @@ class Music(commands.Cog):
self.logger = logging.getLogger(__name__)
self.music = FuzzyMap(lambda m: m.is_released)
for m in asset_manager.music_master.values():
self.music[f'{m.name} {m.special_unit_name}'] = m
if not self.music.has_exact(f'{m.name} {m.special_unit_name}'):
self.music[f'{m.name} {m.special_unit_name}'] = m
difficulty_names = {
'expert': ChartDifficulty.Expert,

@ -19,6 +19,9 @@ class FuzzyMap:
def values(self):
return FuzzyDictValuesView(self)
def has_exact(self, key):
return romanize(key) in self._values
def __delitem__(self, key):
k = romanize(key)
self._values.__delitem__(k)

Loading…
Cancel
Save