You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
569 B
21 lines
569 B
13 years ago
|
from couchpotato.core.event import addEvent, fireEvent
|
||
|
from couchpotato.core.logger import CPLog
|
||
|
from couchpotato.core.plugins.base import Plugin
|
||
|
from couchpotato.environment import Env
|
||
|
|
||
|
log = CPLog(__name__)
|
||
|
|
||
|
|
||
|
class Automation(Plugin):
|
||
|
|
||
|
def __init__(self):
|
||
|
|
||
|
if not Env.setting('development'):
|
||
|
addEvent('app.load', self.addMovies)
|
||
|
|
||
|
def addMovies(self):
|
||
|
|
||
|
movies = fireEvent('automation.get_movies', merge = True)
|
||
|
for imdb_id in movies:
|
||
|
fireEvent('movie.add', params = {'identifier': imdb_id}, force_readd = False)
|