kapsikkum-unmanic – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #!/usr/bin/env python3 |
2 | # -*- coding: utf-8 -*- |
||
3 | |||
4 | """ |
||
5 | unmanic.libraries.py |
||
6 | |||
7 | Written by: Josh.5 <jsunnex@gmail.com> |
||
8 | Date: 06 Feb 2022, (9:44 AM) |
||
9 | |||
10 | Copyright: |
||
11 | Copyright (C) Josh Sunnex - All Rights Reserved |
||
12 | |||
13 | Permission is hereby granted, free of charge, to any person obtaining a copy |
||
14 | of this software and associated documentation files (the "Software"), to deal |
||
15 | in the Software without restriction, including without limitation the rights |
||
16 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||
17 | copies of the Software, and to permit persons to whom the Software is |
||
18 | furnished to do so, subject to the following conditions: |
||
19 | |||
20 | The above copyright notice and this permission notice shall be included in all |
||
21 | copies or substantial portions of the Software. |
||
22 | |||
23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||
24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||
25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
||
26 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
||
27 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
||
28 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
||
29 | OR OTHER DEALINGS IN THE SOFTWARE. |
||
30 | |||
31 | """ |
||
32 | |||
33 | from peewee import * |
||
34 | |||
35 | from unmanic.libs.unmodels.lib import BaseModel |
||
36 | from unmanic.libs.unmodels.tags import Tags |
||
37 | |||
38 | |||
39 | class Libraries(BaseModel): |
||
40 | """ |
||
41 | Libraries |
||
42 | """ |
||
43 | name = TextField(null=False, unique=True) |
||
44 | path = TextField(null=False) |
||
45 | locked = BooleanField(null=False, default=False) |
||
46 | enable_remote_only = BooleanField(null=False, default=False) |
||
47 | enable_scanner = BooleanField(null=False, default=False) |
||
48 | enable_inotify = BooleanField(null=False, default=False) |
||
49 | priority_score = BigIntegerField(null=False, default=0) |
||
50 | # ManyToMany Linking field. Does not create a column in the DB. See linking table below |
||
51 | tags = ManyToManyField(Tags, backref='tags') |
||
52 | |||
53 | |||
54 | # Generate linking table for the 'tags' field above |
||
55 | # https://docs.peewee-orm.com/en/latest/peewee/relationships.html#manytomanyfield |
||
56 | LibraryTags = Libraries.tags.get_through_model() |