😅修复了内存停留的问题

This commit is contained in:
EillesWan 2024-07-23 03:41:42 +08:00
parent 8188b85501
commit 73563aecfa
2 changed files with 47 additions and 19 deletions

View File

@ -753,6 +753,7 @@ async def _(
or ( or (
isinstance(msct_obj, tuple) isinstance(msct_obj, tuple)
and ( and (
(
isinstance(msct_obj[0], Musicreater.MidiConvert) isinstance(msct_obj[0], Musicreater.MidiConvert)
and msct_obj[1] and msct_obj[1]
!= ( != (
@ -764,6 +765,13 @@ async def _(
volume_curve, volume_curve,
) )
) )
or (
msct_obj[0].music_name
!= os.path.splitext(
os.path.basename(usr_data_path / file_to_convert)
)[0].replace(" ", "_")
)
)
) )
) and go_chk_point(): ) and go_chk_point():
msct_obj = Musicreater.MidiConvert.from_midi_file( msct_obj = Musicreater.MidiConvert.from_midi_file(
@ -804,6 +812,12 @@ async def _(
percussion_notechart, percussion_notechart,
volume_curve, volume_curve,
) )
and (
msct_obj[0].music_name
!= os.path.splitext(
os.path.basename(usr_data_path / file_to_convert)
)[0].replace(" ", "_")
)
): ):
msct_obj = msct_obj[0] msct_obj = msct_obj[0]
msct_obj.redefine_execute_format(_args["old-execute-format"]) msct_obj.redefine_execute_format(_args["old-execute-format"])

View File

@ -257,6 +257,7 @@ async def _(
or ( or (
isinstance(msct_obj, tuple) isinstance(msct_obj, tuple)
and ( and (
(
isinstance(msct_obj[0], Musicreater.MidiConvert) isinstance(msct_obj[0], Musicreater.MidiConvert)
and msct_obj[1] and msct_obj[1]
!= ( != (
@ -268,6 +269,13 @@ async def _(
volume_curve, volume_curve,
) )
) )
or (
msct_obj[0].music_name
!= os.path.splitext(
os.path.basename(usr_data_path / file_to_convert)
)[0].replace(" ", "_")
)
)
) )
) and go_chk_point(): ) and go_chk_point():
msct_obj = Musicreater.MidiConvert.from_midi_file( msct_obj = Musicreater.MidiConvert.from_midi_file(
@ -306,6 +314,12 @@ async def _(
percussion_notechart, percussion_notechart,
volume_curve, volume_curve,
) )
and (
msct_obj[0].music_name
!= os.path.splitext(
os.path.basename(usr_data_path / file_to_convert)
)[0].replace(" ", "_")
)
): ):
nonebot.logger.info("载入已有缓存。") nonebot.logger.info("载入已有缓存。")
msct_obj = msct_obj[0] msct_obj = msct_obj[0]