fixed postID message timing

pull/418/head
Jason 3 years ago
parent 43e29af04a
commit 3ecfd14edb

@ -8,14 +8,14 @@ from utils.console import print_step
def check_done(redditobj): # don't set this to be run anyplace that isn't subreddit.py bc of inspect stack def check_done(redditobj): # don't set this to be run anyplace that isn't subreddit.py bc of inspect stack
"""params: """params:
reddit_object: The Reddit Object you received in askreddit.py""" reddit_object: The Reddit Object you received in askreddit.py"""
if getenv('POST_ID'):
print_step(
'You already have done this video but since it was declared specifically in the .env file the program will continue')
return redditobj
with open('./video_creation/data/videos.json', 'r') as done_vids_raw: with open('./video_creation/data/videos.json', 'r') as done_vids_raw:
done_videos = json.load(done_vids_raw) done_videos = json.load(done_vids_raw)
for video in done_videos: for video in done_videos:
if video['id'] == str(redditobj): if video['id'] == str(redditobj):
if getenv('POST_ID'):
print_step(
'You already have done this video but since it was declared specifically in the .env file the program will continue')
return redditobj
print_step('Getting new post as the current one has already been done') print_step('Getting new post as the current one has already been done')
from reddit.subreddit import get_subreddit_threads from reddit.subreddit import get_subreddit_threads
return get_subreddit_threads() # recursive func return get_subreddit_threads() # recursive func

Loading…
Cancel
Save