Skip to content

Commit

Permalink
add db sort
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Aug 28, 2024
1 parent 76503a5 commit cdce636
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
34 changes: 34 additions & 0 deletions ofscraper/utils/args/parse/arguments/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,40 @@
default=False,
)

db_sort_option = click.option(
"-dst",
"--db-sort",
help="""
\b
Changes order of table
""",
default="posted",
required=False,
type=click.Choice(
[
"posted",
"created",
"filename",
"length",
"postid",
"mediaid",
"size"
]
),
)

db_desc_option = click.option(
"-bdc",
"--db-desc",
help=
"""
Change the sort order of table to reverse
""",
is_flag=True,
default=False,
)



force_all_option = click.option(
"-e",
Expand Down
5 changes: 3 additions & 2 deletions ofscraper/utils/args/parse/group_bundles/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
length_min,
media_filter_options_help
)
from ofscraper.utils.args.parse.arguments.content import db_posts_option
from ofscraper.utils.args.parse.arguments.content import db_posts_option, db_sort_option,db_desc_option
from ofscraper.utils.args.parse.groups.user_list import userlist_options
from ofscraper.utils.args.parse.groups.user_select import user_select_options
from ofscraper.utils.args.parse.groups.user_sort import user_sorting_options
Expand All @@ -33,7 +33,6 @@
update_profile_option
)
from ofscraper.utils.args.types.arrow import ArrowType
import ofscraper.utils.args.parse.arguments.utils.date as date_helper



Expand Down Expand Up @@ -105,6 +104,8 @@ def db_args(func):
db_posts_option,
max_count_option,
post_id_filter,
db_sort_option,
db_desc_option,
click.option(
"-cf",
"--created-after",
Expand Down

0 comments on commit cdce636

Please sign in to comment.