Movie search

Profile Settings
This commit is contained in:
Ruud
2011-03-20 22:12:33 +01:00
parent cc260d3a07
commit 288aa8c0a1
34 changed files with 1408 additions and 178 deletions
+32
View File
@@ -0,0 +1,32 @@
from couchpotato import get_session
from couchpotato.core.event import addEvent
from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Library
class LibraryPlugin(Plugin):
def __init__(self):
addEvent('library.add', self.add)
def add(self, attrs = {}):
db = get_session();
l = db.query(Library).filter_by(identifier = attrs.get('identifier')).first()
if not l:
l = Library(
name = attrs.get('name'),
year = attrs.get('year'),
identifier = attrs.get('identifier'),
description = attrs.get('description')
)
db.add(l)
db.commit()
return l
def update(self, item):
pass