cablegates/pandora/item/tasks.py

36 lines
823 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
from datetime import timedelta
from celery.decorators import task, periodic_task
import models
@periodic_task(run_every=timedelta(days=1))
def cronjob(**kwargs):
print "do some cleanup stuff once a day"
2011-01-01 11:44:42 +00:00
2010-09-10 15:12:22 +00:00
@task(ignore_resulsts=True, queue='default')
def update_poster(itemId):
2010-09-23 16:01:48 +00:00
item = models.Item.objects.get(itemId=itemId)
2010-12-01 00:00:33 +00:00
item.make_poster(True)
2011-01-21 10:49:24 +00:00
item.make_icon()
2010-09-10 15:12:22 +00:00
2011-01-01 11:44:42 +00:00
@task(ignore_resulsts=True, queue='default')
2011-01-16 13:28:57 +00:00
def update_external(itemId):
item = models.Item.objects.get(itemId=itemId)
2011-01-16 13:28:57 +00:00
item.update_external()
2011-08-19 16:54:42 +00:00
@task(queue="default")
def update_timeline(itemId):
item = models.Item.objects.get(itemId=itemId)
2011-08-19 16:54:42 +00:00
item.update_timeline()
def load_subtitles(itemId):
item = models.Item.objects.get(itemId=itemId)
2011-08-20 10:06:18 +00:00
item.load_subtitles()
2011-06-02 08:19:15 +00:00