mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #3776 from LoopsCreativeStudio/develop
Kitsu - sync_all_project - add list ignore_projects
This commit is contained in:
commit
afaf854cbd
1 changed files with 4 additions and 2 deletions
|
|
@ -289,13 +289,13 @@ def write_project_to_op(project: dict, dbcon: AvalonMongoDB) -> UpdateOne:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def sync_all_projects(login: str, password: str):
|
def sync_all_projects(login: str, password: str, ignore_projects: list = None):
|
||||||
"""Update all OP projects in DB with Zou data.
|
"""Update all OP projects in DB with Zou data.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
login (str): Kitsu user login
|
login (str): Kitsu user login
|
||||||
password (str): Kitsu user password
|
password (str): Kitsu user password
|
||||||
|
ignore_projects (list): List of unsynced project names
|
||||||
Raises:
|
Raises:
|
||||||
gazu.exception.AuthFailedException: Wrong user login and/or password
|
gazu.exception.AuthFailedException: Wrong user login and/or password
|
||||||
"""
|
"""
|
||||||
|
|
@ -311,6 +311,8 @@ def sync_all_projects(login: str, password: str):
|
||||||
dbcon.install()
|
dbcon.install()
|
||||||
all_projects = gazu.project.all_open_projects()
|
all_projects = gazu.project.all_open_projects()
|
||||||
for project in all_projects:
|
for project in all_projects:
|
||||||
|
if ignore_projects and project["name"] in ignore_projects:
|
||||||
|
continue
|
||||||
sync_project_from_kitsu(dbcon, project)
|
sync_project_from_kitsu(dbcon, project)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue