22 lines
667 B
Python
22 lines
667 B
Python
from apps.betaserie.utils import betaserieUtils
|
|
from celery.worker.state import active_requests
|
|
|
|
betaserie = betaserieUtils()
|
|
|
|
simpsons_id = 12
|
|
|
|
def mark_episode_watched(season,episode,action):
|
|
|
|
print("season_number: "+str(season))
|
|
print("episode_number: "+str(episode))
|
|
|
|
episode_number = "S"+str(season)+"E"+str(episode)
|
|
|
|
episode_id = betaserie.identify_episode(simpsons_id,episode_number)
|
|
|
|
if action == "watched":
|
|
betaserie.mark_episodes_watched(episode_id)
|
|
elif action == "unwatched":
|
|
betaserie.unmark_episodes_watched(episode_id)
|
|
else:
|
|
print("Parameter action not in range") |