diff --git a/mmm-nsf-changer.py b/mmm-nsf-changer.py index c10d874..f4c5542 100644 --- a/mmm-nsf-changer.py +++ b/mmm-nsf-changer.py @@ -71,6 +71,18 @@ def check_folder_structure(megamaker_folder, og_music=False): else: return False +def copy_music_to_ogmusic(path): + path = os.path.abspath(path) + original_filepaths = check_folder_structure(path) + if original_filepaths: + if not filecmp.cmp(os.path.join(path,"Music","MM1","Cutman.nsf"), os.path.join(path, "Music", "MM1", "Oilman.nsf"), shallow=False): + shutil.copytree(os.path.join(path, "Music"), os.path.join(path, "original_music"), dirs_exist_ok=True) + if not os.path.exists(os.path.join(path, "Music")): + os.makedirs(os.path.join(path, "Music")) + else: + print("Cutman.nsf and Oilman.nsf match in Music folder.") + return False + #this needs to check if original_music exists, and if it does restore_ogmusic before moving to og music. def move_music_to_ogmusic(path): path = os.path.abspath(path) @@ -128,7 +140,8 @@ def nsf_changer (nsf_path, megamaker_folder): restore_ogmusic(megamaker_folder) shutil.copy(nsf_path, os.path.join(megamaker_folder, os.path.basename(nsf_path))) nsf_path = os.path.join(megamaker_folder, os.path.basename(nsf_path)) - move_music_to_ogmusic(megamaker_folder) + #move_music_to_ogmusic(megamaker_folder) + copy_music_to_ogmusic(megamaker_folder) recreate_structure(nsf_path, original_path) print("nsf changer returning true") return True