-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from luigi311/dev
Add sync direction flags, seperate out functions, better logging for jellyfin queries
- Loading branch information
Showing
18 changed files
with
1,659 additions
and
905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[BUG]" | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Logs** | ||
If applicable, add logs to help explain your problem ideally with DEBUG set to true, be sure to remove sensitive information | ||
|
||
**Type:** | ||
- [ ] Docker | ||
- [ ] Native | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: "[Feature Request]" | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"python.formatting.provider": "black" | ||
"[python]" : { | ||
"editor.formatOnSave": true, | ||
}, | ||
"python.formatting.provider": "black", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
from src.functions import logger, search_mapping | ||
|
||
|
||
def setup_black_white_lists( | ||
blacklist_library: str, | ||
whitelist_library: str, | ||
blacklist_library_type: str, | ||
whitelist_library_type: str, | ||
blacklist_users: str, | ||
whitelist_users: str, | ||
library_mapping=None, | ||
user_mapping=None, | ||
): | ||
blacklist_library, blacklist_library_type, blacklist_users = setup_black_lists( | ||
blacklist_library, | ||
blacklist_library_type, | ||
blacklist_users, | ||
library_mapping, | ||
user_mapping, | ||
) | ||
|
||
whitelist_library, whitelist_library_type, whitelist_users = setup_white_lists( | ||
whitelist_library, | ||
whitelist_library_type, | ||
whitelist_users, | ||
library_mapping, | ||
user_mapping, | ||
) | ||
|
||
return ( | ||
blacklist_library, | ||
whitelist_library, | ||
blacklist_library_type, | ||
whitelist_library_type, | ||
blacklist_users, | ||
whitelist_users, | ||
) | ||
|
||
|
||
def setup_black_lists( | ||
blacklist_library, | ||
blacklist_library_type, | ||
blacklist_users, | ||
library_mapping=None, | ||
user_mapping=None, | ||
): | ||
if blacklist_library: | ||
if len(blacklist_library) > 0: | ||
blacklist_library = blacklist_library.split(",") | ||
blacklist_library = [x.strip() for x in blacklist_library] | ||
if library_mapping: | ||
temp_library = [] | ||
for library in blacklist_library: | ||
library_other = search_mapping(library_mapping, library) | ||
if library_other: | ||
temp_library.append(library_other) | ||
|
||
blacklist_library = blacklist_library + temp_library | ||
else: | ||
blacklist_library = [] | ||
logger(f"Blacklist Library: {blacklist_library}", 1) | ||
|
||
if blacklist_library_type: | ||
if len(blacklist_library_type) > 0: | ||
blacklist_library_type = blacklist_library_type.split(",") | ||
blacklist_library_type = [x.lower().strip() for x in blacklist_library_type] | ||
else: | ||
blacklist_library_type = [] | ||
logger(f"Blacklist Library Type: {blacklist_library_type}", 1) | ||
|
||
if blacklist_users: | ||
if len(blacklist_users) > 0: | ||
blacklist_users = blacklist_users.split(",") | ||
blacklist_users = [x.lower().strip() for x in blacklist_users] | ||
if user_mapping: | ||
temp_users = [] | ||
for user in blacklist_users: | ||
user_other = search_mapping(user_mapping, user) | ||
if user_other: | ||
temp_users.append(user_other) | ||
|
||
blacklist_users = blacklist_users + temp_users | ||
else: | ||
blacklist_users = [] | ||
logger(f"Blacklist Users: {blacklist_users}", 1) | ||
|
||
return blacklist_library, blacklist_library_type, blacklist_users | ||
|
||
|
||
def setup_white_lists( | ||
whitelist_library, | ||
whitelist_library_type, | ||
whitelist_users, | ||
library_mapping=None, | ||
user_mapping=None, | ||
): | ||
if whitelist_library: | ||
if len(whitelist_library) > 0: | ||
whitelist_library = whitelist_library.split(",") | ||
whitelist_library = [x.strip() for x in whitelist_library] | ||
if library_mapping: | ||
temp_library = [] | ||
for library in whitelist_library: | ||
library_other = search_mapping(library_mapping, library) | ||
if library_other: | ||
temp_library.append(library_other) | ||
|
||
whitelist_library = whitelist_library + temp_library | ||
else: | ||
whitelist_library = [] | ||
logger(f"Whitelist Library: {whitelist_library}", 1) | ||
|
||
if whitelist_library_type: | ||
if len(whitelist_library_type) > 0: | ||
whitelist_library_type = whitelist_library_type.split(",") | ||
whitelist_library_type = [x.lower().strip() for x in whitelist_library_type] | ||
else: | ||
whitelist_library_type = [] | ||
logger(f"Whitelist Library Type: {whitelist_library_type}", 1) | ||
|
||
if whitelist_users: | ||
if len(whitelist_users) > 0: | ||
whitelist_users = whitelist_users.split(",") | ||
whitelist_users = [x.lower().strip() for x in whitelist_users] | ||
if user_mapping: | ||
temp_users = [] | ||
for user in whitelist_users: | ||
user_other = search_mapping(user_mapping, user) | ||
if user_other: | ||
temp_users.append(user_other) | ||
|
||
whitelist_users = whitelist_users + temp_users | ||
else: | ||
whitelist_users = [] | ||
else: | ||
whitelist_users = [] | ||
logger(f"Whitelist Users: {whitelist_users}", 1) | ||
|
||
return whitelist_library, whitelist_library_type, whitelist_users |
Oops, something went wrong.