Skip to content

Commit

Permalink
Wire up all_thumbnails option to importcontent management command
Browse files Browse the repository at this point in the history
The CLI option is `--all-thumbnails` and defaults to `False`.
  • Loading branch information
dbnicholson committed Jun 2, 2023
1 parent c7523bb commit fd090b8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions kolibri/core/content/management/commands/importcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ def add_arguments(self, parser):
help="Import all content, not just that which this Kolibri instance can render",
)

parser.add_argument(
"--all-thumbnails",
action="store_true",
default=False,
dest="all_thumbnails",
help="Import thumbnails for all content nodes regardless of included or excluded node IDs",
)

parser.add_argument(
"--import_updates",
action="store_true",
Expand Down Expand Up @@ -177,6 +185,7 @@ def download_content(
baseurl=None,
peer_id=None,
renderable_only=True,
all_thumbnails=False,
import_updates=False,
fail_on_error=False,
timeout=transfer.Transfer.DEFAULT_TIMEOUT,
Expand All @@ -199,6 +208,7 @@ def download_content(
baseurl=baseurl,
peer_id=peer_id,
renderable_only=renderable_only,
all_thumbnails=all_thumbnails,
fail_on_error=fail_on_error,
timeout=timeout,
content_dir=content_dir,
Expand All @@ -210,6 +220,7 @@ def download_content(
baseurl=baseurl,
peer_id=peer_id,
renderable_only=renderable_only,
all_thumbnails=all_thumbnails,
fail_on_error=fail_on_error,
timeout=timeout,
content_dir=content_dir,
Expand All @@ -225,6 +236,7 @@ def copy_content(
node_ids=None,
exclude_node_ids=None,
renderable_only=True,
all_thumbnails=False,
import_updates=False,
fail_on_error=False,
content_dir=None,
Expand All @@ -242,6 +254,7 @@ def copy_content(
path=path,
drive_id=drive_id,
renderable_only=renderable_only,
all_thumbnails=all_thumbnails,
fail_on_error=fail_on_error,
content_dir=content_dir,
)
Expand All @@ -251,6 +264,7 @@ def copy_content(
path=path,
drive_id=drive_id,
renderable_only=renderable_only,
all_thumbnails=all_thumbnails,
fail_on_error=fail_on_error,
content_dir=content_dir,
)
Expand All @@ -261,6 +275,7 @@ def copy_content(
node_ids=node_ids,
exclude_node_ids=exclude_node_ids,
renderable_only=renderable_only,
all_thumbnails=all_thumbnails,
fail_on_error=fail_on_error,
content_dir=content_dir,
)
Expand Down Expand Up @@ -293,6 +308,7 @@ def handle(self, *args, **options):
baseurl=options["baseurl"],
peer_id=options["peer_id"],
renderable_only=options["renderable_only"],
all_thumbnails=options["all_thumbnails"],
import_updates=options["import_updates"],
fail_on_error=options["fail_on_error"],
timeout=options["timeout"],
Expand All @@ -313,6 +329,7 @@ def handle(self, *args, **options):
node_ids=options["node_ids"],
exclude_node_ids=options["exclude_node_ids"],
renderable_only=options["renderable_only"],
all_thumbnails=options["all_thumbnails"],
import_updates=options["import_updates"],
fail_on_error=options["fail_on_error"],
content_dir=options["content_dir"],
Expand Down

0 comments on commit fd090b8

Please sign in to comment.