mirror of
https://github.com/Xevion/v1.xevion.dev.git
synced 2025-12-13 12:13:33 -06:00
PyCharm grand repo wide reformat with black formatter
This commit is contained in:
@@ -11,7 +11,7 @@ from . import pull
|
||||
|
||||
def main():
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logging.info('Pulling data from Spotify')
|
||||
logging.info("Pulling data from Spotify")
|
||||
refresh()
|
||||
process.main()
|
||||
|
||||
@@ -19,14 +19,20 @@ def main():
|
||||
# Refreshes tracks from files if the token from Spotipy has expired,
|
||||
# thus keeping us up to date in most cases while keeping rate limits
|
||||
def refresh():
|
||||
file_path = os.path.join(sys.path[0], f'.cache-{auth.USERNAME}')
|
||||
file_path = os.path.join(sys.path[0], f".cache-{auth.USERNAME}")
|
||||
if os.path.exists(file_path):
|
||||
cache = json.load(open(file_path, 'r'))
|
||||
if True or time.time() > cache['expires_at']:
|
||||
logging.info('Refreshing Spotify data by pulling tracks, this may take a moment.')
|
||||
cache = json.load(open(file_path, "r"))
|
||||
if True or time.time() > cache["expires_at"]:
|
||||
logging.info(
|
||||
"Refreshing Spotify data by pulling tracks, this may take a moment."
|
||||
)
|
||||
pull.main()
|
||||
else:
|
||||
logging.info('Spotify data deemed to be recent enough (under {} seconds old)'.format(cache['expires_in']))
|
||||
logging.info(
|
||||
"Spotify data deemed to be recent enough (under {} seconds old)".format(
|
||||
cache["expires_in"]
|
||||
)
|
||||
)
|
||||
else:
|
||||
pull.main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user