diff --git a/.gitignore b/.gitignore index e4e5f6c..d684990 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*~ \ No newline at end of file +*~ +state.json \ No newline at end of file diff --git a/next_song.py b/next_song.py old mode 100644 new mode 100755 index deea092..b9d5085 --- a/next_song.py +++ b/next_song.py @@ -23,3 +23,6 @@ if __name__ == "__main__": print(random.choice(glob.glob(f"{script_dir}/songs/*.ogg"))) else: exit(1) + + with open(f"{script_dir}/state.json", "w") as f: + json.dump(state, f, indent=4)