Skip to content

Commit 6929814

Browse files
committed
fix: query deleted, args.where is a list
1 parent 6b66cad commit 6929814

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

xklb/db_media.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def filter_args_sql(args, m_columns):
293293
return f"""
294294
{'and path like "http%"' if getattr(args, 'safe', False) else ''}
295295
{f'and path not like "{args.keep_dir}%"' if getattr(args, 'keep_dir', False) and Path(args.keep_dir).exists() else ''}
296-
{'and COALESCE(time_deleted,0) = 0' if 'time_deleted' in m_columns and "deleted" not in (getattr(args, 'sort_groups_by',None) or '') and "time_deleted" not in args.where else ''}
296+
{'and COALESCE(time_deleted,0) = 0' if 'time_deleted' in m_columns and "deleted" not in (getattr(args, 'sort_groups_by',None) or '') and "time_deleted" not in " ".join(args.where) else ''}
297297
{'AND (score IS NULL OR score > 7)' if 'score' in m_columns else ''}
298298
{'AND (upvote_ratio IS NULL OR upvote_ratio > 0.73)' if 'upvote_ratio' in m_columns else ''}
299299
{'AND COALESCE(time_downloaded,0) = 0' if args.online_media_only and 'time_downloaded' in m_columns else ''}

xklb/play_actions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def ii(string):
339339
limit = 16 * (args.limit or consts.DEFAULT_PLAY_QUEUE)
340340
where_not_deleted = (
341341
"where COALESCE(time_deleted,0) = 0"
342-
if "time_deleted" in m_columns and "deleted" not in args.sort_groups_by and "time_deleted" not in args.where
342+
if "time_deleted" in m_columns and "deleted" not in args.sort_groups_by and "time_deleted" not in " ".join(args.where)
343343
else ""
344344
)
345345
args.filter_sql.append(

xklb/utils/arg_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def parse_args_sort(args) -> None:
159159
[
160160
args.print,
161161
consts.PYTEST_RUNNING,
162-
"subtitle_count" in args.where,
162+
"subtitle_count" in " ".join(args.where),
163163
args.limit != consts.DEFAULT_PLAY_QUEUE,
164164
],
165165
)

0 commit comments

Comments
 (0)