def auto_update_download_status(): downloading = Movie.get_downloading_hashes() modified = [] for mov in downloading: if check_if_torrent_complete(mov["hash"]): mov["movie"].set_status(Movie.DOWNLOAD_COMPLETE) mov["movie"].update_file_location(get_main_file_path(mov["hash"])) upload_movie(mov["movie"].pk) modified.append(mov["movie"]) return {"modified": modified, "downloading": downloading}