commit 0db71b5
uint
·
2026-08-26 15:13:15 +0000 UTC
parent db12534
sh: use same media filter as parados
1 files changed,
+7,
-4
+7,
-4
1@@ -69,12 +69,15 @@ validate_id()
2 esac
3 }
4
5-# check if path is video based on extension
6-is_video_path()
7+# check if path has an extension supported by parados
8+is_supported_path()
9 {
10 p=$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')
11 case "$p" in
12- *.mkv|*.mp4|*.webm|*.mov|*.m4v|*.avi|*.mpg|*.mpeg|*.ts|*.m2ts|*.flv|*.wmv|*.3gp) return 0 ;;
13+ *.mp3|*.m4a|*.aac|*.flac|*.wav|*.ogg|*.opus|\
14+ *.mp4|*.mkv|*.webm|*.mov|\
15+ *.jpg|*.jpeg|*.png|*.gif|*.webp|\
16+ *.vtt|*.srt|*.pdf) return 0 ;;
17 *) return 1 ;;
18 esac
19 }
20@@ -134,7 +137,7 @@ refresh_library()
21 200)
22 parse_library_json "$tmp" | while IFS="$TAB" read -r id path; do
23 validate_id "$id" || continue
24- is_video_path "$path" || continue
25+ is_supported_path "$path" || continue
26 printf '%s\t%s\n' "$id" "$path"
27 done | sort -f -t "$TAB" -k2,2 > "$LIB_FILE" || { printf '%s\n' "failed parsing /library response" >&2; return 1; }
28 ;;