small fixes

small fixes
This commit is contained in:
rintyuu 2024-08-17 11:06:25 -07:00
parent f3a56a97b3
commit 5c7ee9d8fe

View file

@ -5,6 +5,9 @@ from spotipy.oauth2 import SpotifyOAuth
import time import time
from dotenv import load_dotenv from dotenv import load_dotenv
# Number of seconds to check if same song is playing
interval = "15"
# Load environment variables from .env file # Load environment variables from .env file
load_dotenv() load_dotenv()
@ -23,6 +26,9 @@ discord_webhook_url = os.getenv('DISCORD_WEBHOOK_URL')
# Initialize variables to track the last played track # Initialize variables to track the last played track
last_track_id = None last_track_id = None
interval_start = 1
interval_verif = False
while True: while True:
current_epoch = time.time() current_epoch = time.time()
@ -93,7 +99,13 @@ while True:
else: else:
print("No track is currently playing.") print("No track is currently playing.")
# Wait for a certain time before checking again (e.g., 15 seconds) if interval_start == 1 and not interval_verif:
print("it has been 15 seconds") print("ignore this seconds has passed message please")
time.sleep(15) print("im still working out the bugs in this program")
interval_start = 0
interval_verif = True
# Wait for a certain time before checking again (e.g., 15 seconds)
print("it has been", interval,"seconds")
time.sleep(int(interval))