Notifications
This commit is contained in:
1 parent
288aa8c0a1
commit
85fc1c01ee
67 files changed
+3270
-400
No files matched your search
@@ -2,8 +2,10 @@ 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, \
|
||||
Float
|
||||
from libs.elixir.options import using_options
|
||||
from libs.elixir.relationships import ManyToMany
|
||||
from sqlalchemy.types import Integer, Unicode, UnicodeText, Boolean, Float, \
|
||||
String
|
||||
|
||||
options_defaults["shortnames"] = True
|
||||
|
||||
@@ -20,24 +22,48 @@ class Movie(Entity):
|
||||
The files belonging to the movie object are global for the whole movie
|
||||
such as trailers, nfo, thumbnails"""
|
||||
|
||||
library = ManyToOne('Library')
|
||||
last_edit = Field(Integer)
|
||||
|
||||
library = ManyToOne('Library')
|
||||
status = ManyToOne('Status')
|
||||
profile = ManyToOne('Profile')
|
||||
releases = OneToMany('Release')
|
||||
files = OneToMany('File')
|
||||
files = ManyToMany('File')
|
||||
|
||||
|
||||
class Library(Entity):
|
||||
""""""
|
||||
|
||||
title = Field(Unicode)
|
||||
year = Field(Integer)
|
||||
identifier = Field(Unicode)
|
||||
identifier = Field(String(20))
|
||||
rating = Field(Float)
|
||||
|
||||
plot = Field(UnicodeText)
|
||||
tagline = Field(UnicodeText(255))
|
||||
|
||||
status = ManyToOne('Status')
|
||||
movie = OneToMany('Movie')
|
||||
titles = OneToMany('LibraryTitle')
|
||||
files = ManyToMany('File')
|
||||
|
||||
|
||||
class LibraryTitle(Entity):
|
||||
""""""
|
||||
|
||||
title = Field(Unicode)
|
||||
default = Field(Boolean)
|
||||
|
||||
language = OneToMany('Language')
|
||||
libraries = ManyToOne('Library')
|
||||
|
||||
|
||||
class Language(Entity):
|
||||
""""""
|
||||
|
||||
identifier = Field(String(20))
|
||||
label = Field(Unicode)
|
||||
|
||||
titles = ManyToOne('LibraryTitle')
|
||||
|
||||
|
||||
class Release(Entity):
|
||||
@@ -47,7 +73,7 @@ class Release(Entity):
|
||||
movie = ManyToOne('Movie')
|
||||
status = ManyToOne('Status')
|
||||
quality = ManyToOne('Quality')
|
||||
files = OneToMany('File')
|
||||
files = ManyToMany('File')
|
||||
history = OneToMany('History')
|
||||
|
||||
|
||||
@@ -55,41 +81,49 @@ class Status(Entity):
|
||||
"""The status of a release, such as Downloaded, Deleted, Wanted etc"""
|
||||
|
||||
identifier = Field(String(20), unique = True)
|
||||
label = Field(String(20))
|
||||
label = Field(Unicode(20))
|
||||
|
||||
releases = OneToMany('Release')
|
||||
movies = OneToMany('Movie')
|
||||
|
||||
|
||||
class Quality(Entity):
|
||||
"""Quality name of a release, DVD, 720P, DVD-Rip etc"""
|
||||
using_options(order_by = 'order')
|
||||
|
||||
identifier = Field(String(20), unique = True)
|
||||
label = Field(String(20))
|
||||
label = Field(Unicode(20))
|
||||
order = Field(Integer)
|
||||
|
||||
size_min = Field(Integer)
|
||||
size_max = Field(Integer)
|
||||
|
||||
releases = OneToMany('Release')
|
||||
profile_types = ManyToOne('ProfileType')
|
||||
profile_types = OneToMany('ProfileType')
|
||||
|
||||
|
||||
class Profile(Entity):
|
||||
""""""
|
||||
using_options(order_by = 'order')
|
||||
|
||||
identifier = Field(String(20), unique = True)
|
||||
label = Field(Unicode(50))
|
||||
order = Field(Integer)
|
||||
wait_for = Field(Integer)
|
||||
core = Field(Boolean)
|
||||
hide = Field(Boolean)
|
||||
|
||||
movie = OneToMany('Movie')
|
||||
profile_type = OneToMany('ProfileType')
|
||||
types = OneToMany('ProfileType', cascade = 'all, delete-orphan')
|
||||
|
||||
|
||||
class ProfileType(Entity):
|
||||
""""""
|
||||
using_options(order_by = 'order')
|
||||
|
||||
order = Field(Integer)
|
||||
mark_completed = Field(Boolean)
|
||||
finish = Field(Boolean)
|
||||
wait_for = Field(Integer)
|
||||
|
||||
type = OneToMany('Quality')
|
||||
quality = ManyToOne('Quality')
|
||||
profile = ManyToOne('Profile')
|
||||
|
||||
|
||||
@@ -97,19 +131,22 @@ class File(Entity):
|
||||
"""File that belongs to a release."""
|
||||
|
||||
path = Field(Unicode(255), nullable = False, unique = True)
|
||||
part = Field(Integer)
|
||||
part = Field(Integer, default = 1)
|
||||
|
||||
history = OneToMany('RenameHistory')
|
||||
movie = ManyToOne('Movie')
|
||||
release = ManyToOne('Release')
|
||||
type = ManyToOne('FileType')
|
||||
properties = OneToMany('FileProperty')
|
||||
|
||||
history = OneToMany('RenameHistory')
|
||||
movie = ManyToMany('Movie')
|
||||
release = ManyToMany('Release')
|
||||
library = ManyToMany('Library')
|
||||
|
||||
|
||||
class FileType(Entity):
|
||||
"""Types could be trailer, subtitle, movie, partial movie etc."""
|
||||
|
||||
identifier = Field(String(20), unique = True)
|
||||
type = Field(Unicode(20))
|
||||
name = Field(Unicode(50), nullable = False)
|
||||
|
||||
files = OneToMany('File')
|
||||
@@ -135,8 +172,8 @@ class History(Entity):
|
||||
class RenameHistory(Entity):
|
||||
"""Remembers from where to where files have been moved."""
|
||||
|
||||
old = Field(String(255))
|
||||
new = Field(String(255))
|
||||
old = Field(Unicode(255))
|
||||
new = Field(Unicode(255))
|
||||
|
||||
file = ManyToOne('File')
|
||||
|
||||
|
||||
Reference in new issue
Block a user