def update_show(request): key = None show = None try: key = request.POST.get("key", None) if key is None: raise Http404 show = Show.get_all_dict().get(key, None) if show is None: raise Http404 show.update() except Http404: raise Http404 except Exception as e: logging.error("Error Updating Show (%s)%s: %s" % (show, key, e)) return HttpResponse("Done (with errors, %s(%s))" % (show, key)) logging.debug("Done updating show %s(%s)" % (show, key)) return HttpResponse("Done: %s(%s)" % (show, key))
def get_shows_old(self): show_dict = Show.get_all_dict() return [show_dict[str(sub_item.show_id)] for sub_item in self.subscriptionitem_set if str(sub_item.show_id) in show_dict]
def get_shows(self): show_dict = Show.get_all_dict() return [show_dict[show_key] for show_key in self.get_show_cache() if show_key in show_dict]
def get_choices(): shows = Show.get_all_ordered() return [(show.pk, {"name": show.ordered_name, "new": show.is_new, "provider_id": show.provider_id}) for show in shows]
def update(request): shows = Show.get_all_ordered() for show in shows: show.add_update_task() Episode.add_clear_cache_task("series") return HttpResponse("Done: %d" % (len(shows)))
def clear_cache(request): Show.clear_cache() Episode.clear_cache() return HttpResponse("Done.")