Movie search
Profile Settings
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from __future__ import with_statement
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent
|
||||
from couchpotato.core.helpers.encoding import is_int
|
||||
from couchpotato.core.helpers.request import getParams, jsonified
|
||||
import ConfigParser
|
||||
import os.path
|
||||
@@ -60,7 +61,7 @@ class Settings():
|
||||
return default
|
||||
|
||||
def cleanValue(self, value):
|
||||
if(self.is_int(value)):
|
||||
if(is_int(value)):
|
||||
return int(value)
|
||||
|
||||
if str(value).lower() in self.bool:
|
||||
@@ -91,13 +92,6 @@ class Settings():
|
||||
if not self.p.has_option(section, option):
|
||||
self.p.set(section, option, value)
|
||||
|
||||
def is_int(self, value):
|
||||
try:
|
||||
int(value)
|
||||
return True
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def addOptions(self, section_name, options):
|
||||
self.options[section_name] = options
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ from elixir.entity import Entity
|
||||
from elixir.fields import Field
|
||||
from elixir.options import options_defaults
|
||||
from elixir.relationships import OneToMany, ManyToOne
|
||||
from sqlalchemy.types import Integer, String, Unicode, UnicodeText, Boolean
|
||||
from sqlalchemy.types import Integer, String, Unicode, UnicodeText, Boolean, \
|
||||
Float
|
||||
|
||||
options_defaults["shortnames"] = True
|
||||
|
||||
@@ -19,13 +20,26 @@ class Movie(Entity):
|
||||
The files belonging to the movie object are global for the whole movie
|
||||
such as trailers, nfo, thumbnails"""
|
||||
|
||||
mooli_id = Field(Integer)
|
||||
library = ManyToOne('Library')
|
||||
|
||||
profile = ManyToOne('Profile')
|
||||
releases = OneToMany('Release')
|
||||
files = OneToMany('File')
|
||||
|
||||
|
||||
class Library(Entity):
|
||||
|
||||
title = Field(Unicode)
|
||||
year = Field(Integer)
|
||||
identifier = Field(Unicode)
|
||||
rating = Field(Float)
|
||||
|
||||
plot = Field(UnicodeText)
|
||||
tagline = Field(UnicodeText(255))
|
||||
|
||||
movie = OneToMany('Movie')
|
||||
|
||||
|
||||
class Release(Entity):
|
||||
"""Logically groups all files that belong to a certain release, such as
|
||||
parts of a movie, subtitles."""
|
||||
@@ -55,6 +69,7 @@ class Quality(Entity):
|
||||
releases = OneToMany('Release')
|
||||
profile_types = ManyToOne('ProfileType')
|
||||
|
||||
|
||||
class Profile(Entity):
|
||||
""""""
|
||||
|
||||
@@ -66,6 +81,7 @@ class Profile(Entity):
|
||||
movie = OneToMany('Movie')
|
||||
profile_type = OneToMany('ProfileType')
|
||||
|
||||
|
||||
class ProfileType(Entity):
|
||||
""""""
|
||||
|
||||
@@ -76,6 +92,7 @@ class ProfileType(Entity):
|
||||
type = OneToMany('Quality')
|
||||
profile = ManyToOne('Profile')
|
||||
|
||||
|
||||
class File(Entity):
|
||||
"""File that belongs to a release."""
|
||||
|
||||
@@ -114,6 +131,7 @@ class History(Entity):
|
||||
message = Field(UnicodeText())
|
||||
release = ManyToOne('Release')
|
||||
|
||||
|
||||
class RenameHistory(Entity):
|
||||
"""Remembers from where to where files have been moved."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user