Skip to content

Commit dce0dda

Browse files
committed
fs_extract play_actions consts
1 parent 6053556 commit dce0dda

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

xklb/fs_extract.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ def extract_metadata(mp_args, path) -> Optional[Dict[str, int]]:
176176
if not Path(path).exists():
177177
return media
178178

179-
if objects.is_profile(mp_args, DBType.audio) and (
180-
ext in (consts.AUDIO_ONLY_EXTENSIONS | consts.VIDEO_EXTENSIONS) or is_scan_all_files
181-
):
179+
if objects.is_profile(mp_args, DBType.audio) and (ext in consts.AUDIO_ONLY_EXTENSIONS or is_scan_all_files):
182180
media |= av.munge_av_tags(mp_args, path)
183181
elif objects.is_profile(mp_args, DBType.video) and (ext in consts.VIDEO_EXTENSIONS or is_scan_all_files):
184182
media |= av.munge_av_tags(mp_args, path)

xklb/play_actions.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,7 @@ def process_playqueue(args) -> None:
521521
elif args.action in SC.watch:
522522
media = [{"path": s} for s in file_utils.rglob(str(p), consts.VIDEO_EXTENSIONS)[0]]
523523
elif args.action == SC.listen:
524-
media = [
525-
{"path": s}
526-
for s in file_utils.rglob(str(p), consts.VIDEO_EXTENSIONS | consts.AUDIO_ONLY_EXTENSIONS)[0]
527-
]
524+
media = [{"path": s} for s in file_utils.rglob(str(p), consts.AUDIO_ONLY_EXTENSIONS)[0]]
528525
elif args.action in SC.view:
529526
media = [{"path": s} for s in file_utils.rglob(str(p), consts.IMAGE_EXTENSIONS)[0]]
530527
elif args.action in SC.read:

xklb/utils/consts.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def reddit_frequency(frequency) -> str:
131131

132132
SPEECH_RECOGNITION_EXTENSIONS = set("mp3|ogg|wav".split("|"))
133133
OCR_EXTENSIONS = set("gif|jpg|jpeg|png|tif|tff|tiff".split("|"))
134-
AUDIO_ONLY_EXTENSIONS = set("mka|opus|oga|ogg|mp3|mpga|m2a|m4a|flac|wav|wma|aac|aa3|ac3|ape|mid|midi".split("|"))
134+
AUDIO_ONLY_EXTENSIONS = set("mka|opus|oga|ogg|mp3|mpga|m2a|m4a|m4b|flac|wav|wma|aac|aa3|ac3|ape|mid|midi".split("|"))
135135
VIDEO_EXTENSIONS = set(
136136
(
137137
"str|aa|aax|acm|adf|adp|dtk|ads|ss2|adx|aea|afc|aix|al|apl"
@@ -145,7 +145,7 @@ def reddit_frequency(frequency) -> str:
145145
"|dsm|dtm|far|gdm|ice|imf|it|j2b|m15|mdl|med|mmcmp|mms|mo3|mod|mptm"
146146
"|mt2|mtm|nst|okt|ogm|ogv|plm|ppm|psm|pt36|ptm|s3m|sfx|sfx2|st26|stk|stm"
147147
"|stp|ult|umx|wow|xm|xpk|flv|dat|lvf|m4v|mkv|ts|tp|mk3d|webm|mca|mcc"
148-
"|mjpg|mjpeg|mpg|mpeg|mpo|j2k|mlp|mods|moflex|mov|mp4|3gp|3g2|mj2|psp|m4b"
148+
"|mjpg|mjpeg|mpg|mpeg|mpo|j2k|mlp|mods|moflex|mov|mp4|3gp|3g2|mj2|psp"
149149
"|ism|ismv|isma|f4v|mp2|mpa|mpc|mjpg|mpl2|msf|mtaf|ul|musx|mvi|mxg"
150150
"|v|nist|sph|nsp|nut|obu|oma|omg|pjs|pvf|yuv|cif|qcif|rgb|rt|rsd|rmvb|rm"
151151
"|rsd|rso|sw|sb|sami|sbc|msbc|sbg|scc|sdr2|sds|sdx|ser|sga|shn|vb|son|imx"

0 commit comments

Comments
 (0)