Skip to content

Commit

Permalink
2.8.010
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanjacobd committed May 12, 2024
1 parent 5bac38c commit 01a332a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To stop playing press Ctrl+C in either the terminal or mpv
<details><summary>List all subcommands</summary>

$ library
library (v2.8.009; 72 subcommands)
library (v2.8.010; 72 subcommands)

Create database subcommands:
╭───────────────┬──────────────────────────────────────────╮
Expand Down
67 changes: 0 additions & 67 deletions ff.py

This file was deleted.

2 changes: 1 addition & 1 deletion xklb/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.8.009"
__version__ = "2.8.010"
5 changes: 3 additions & 2 deletions xklb/mediadb/db_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def get_dir_media(args, dirs: Collection, include_subdirs=False, limit=2_000) ->
WHERE 1=1
and m.id in (select id from {args.table})
{filter_paths}
{" ".join(args.filter_sql)}
GROUP BY m.id, m.path
)
SELECT *
Expand Down Expand Up @@ -532,13 +533,13 @@ def get_related_media(args, m: dict) -> list[dict]:
LEFT JOIN history h on h.media_id = m.id
WHERE 1=1
and path != :path
{'' if args.related >= consts.RELATED_NO_FILTER else (" ".join(args.filter_sql) or '')}
{'' if args.related >= consts.RELATED_NO_FILTER else " ".join(args.filter_sql)}
GROUP BY m.id, m.path
)
SELECT *
FROM m
WHERE 1=1
{'' if args.related >= consts.RELATED_NO_FILTER else (" ".join(args.aggregate_filter_sql) or '')}
{'' if args.related >= consts.RELATED_NO_FILTER else " ".join(args.aggregate_filter_sql)}
ORDER BY play_count
, m.path like "http%"
, {'rank' if 'sort' in args.defaults else f'ntile(1000) over (order by rank)' + (f', {args.sort}' if args.sort else '')}
Expand Down
8 changes: 6 additions & 2 deletions xklb/utils/arggroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def get_caller_name():


def args_post(args, parser, create_db=False):
args.defaults = {k:v for k, v in args.__dict__.items() if parser.get_default(k) == v}
settings = {k: v for k, v in args.__dict__.items() if k not in ["database", "verbose", "defaults"] + list(args.defaults.keys())}
args.defaults = {k: v for k, v in args.__dict__.items() if parser.get_default(k) == v}
settings = {
k: v
for k, v in args.__dict__.items()
if k not in ["database", "verbose", "defaults"] + list(args.defaults.keys())
}
args.extractor_config = {
k: v for k, v in settings.items() if k not in ["db", "paths", "actions", "backfill_pages"]
} | (getattr(args, "extractor_config", None) or {})
Expand Down

0 comments on commit 01a332a

Please sign in to comment.