promote out of copyright movies automatically
This commit is contained in:
parent
079d2b5ad7
commit
cf9999e24a
1 changed files with 6 additions and 0 deletions
6
tasks.py
6
tasks.py
|
@ -1,5 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
from datetime import datetime
|
||||
|
||||
from celery.task import periodic_task
|
||||
from celery.schedules import crontab
|
||||
|
@ -11,7 +12,12 @@ import item.models
|
|||
@periodic_task(run_every=crontab(hour=6, minute=0), queue='encoding')
|
||||
def cron(**kwargs):
|
||||
update_double_imdb()
|
||||
outofcopyright()
|
||||
|
||||
def outofcopyright():
|
||||
for i in item.models.Item.objects.filter(sort__year__lt=datetime.now().year - 60, level=2):
|
||||
i.level = 1
|
||||
i.save()
|
||||
|
||||
def update_double_imdb():
|
||||
l = itemlist.models.List.get(name='Double IMDb', user__username='j')
|
||||
|
|
Loading…
Reference in a new issue