feat: 媒体库多根配置生效并增强扫描健壮性
This commit is contained in:
parent
2ca9e0a975
commit
78554ea022
|
|
@ -47,8 +47,8 @@ guide to switching back to the official build once the upstream fix lands.
|
||||||
./build-ytdlp.sh
|
./build-ytdlp.sh
|
||||||
|
|
||||||
docker buildx build --platform linux/amd64 \
|
docker buildx build --platform linux/amd64 \
|
||||||
--build-arg VERSION=1.30 \
|
--build-arg VERSION=1.31 \
|
||||||
-t 192.168.2.212:3000/tigeren/metube:1.30 \
|
-t 192.168.2.212:3000/tigeren/metube:1.31 \
|
||||||
--push .
|
--push .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,8 @@ class Config:
|
||||||
self.LIBRARY_ROOTS = normalize_library_roots(roots)
|
self.LIBRARY_ROOTS = normalize_library_roots(roots)
|
||||||
if self.LIBRARY_DIRS and not self.LIBRARY_ROOTS:
|
if self.LIBRARY_DIRS and not self.LIBRARY_ROOTS:
|
||||||
log.warning('Library feature disabled: none of LIBRARY_DIRS exists')
|
log.warning('Library feature disabled: none of LIBRARY_DIRS exists')
|
||||||
|
if self.LIBRARY_ROOTS:
|
||||||
|
log.info('Library roots: ' + ', '.join(f'{label or "(root)"} -> {path}' for label, path in self.LIBRARY_ROOTS))
|
||||||
|
|
||||||
if not self.URL_PREFIX.endswith('/'):
|
if not self.URL_PREFIX.endswith('/'):
|
||||||
self.URL_PREFIX += '/'
|
self.URL_PREFIX += '/'
|
||||||
|
|
@ -402,7 +404,10 @@ def _scan_library_folders(roots):
|
||||||
exclude = re.compile(config.CUSTOM_DIRS_EXCLUDE_REGEX) if config.CUSTOM_DIRS_EXCLUDE_REGEX else None
|
exclude = re.compile(config.CUSTOM_DIRS_EXCLUDE_REGEX) if config.CUSTOM_DIRS_EXCLUDE_REGEX else None
|
||||||
folders = []
|
folders = []
|
||||||
for label, root in roots:
|
for label, root in roots:
|
||||||
for dirpath, dirnames, filenames in os.walk(root):
|
def _on_walk_error(exc):
|
||||||
|
log.warning(f'Library scan error under "{root}": {exc!r}')
|
||||||
|
|
||||||
|
for dirpath, dirnames, filenames in os.walk(root, onerror=_on_walk_error):
|
||||||
rel = os.path.relpath(dirpath, root)
|
rel = os.path.relpath(dirpath, root)
|
||||||
dirnames[:] = [d for d in dirnames
|
dirnames[:] = [d for d in dirnames
|
||||||
if not (exclude and exclude.search(os.path.normpath(os.path.join(rel, d))))]
|
if not (exclude and exclude.search(os.path.normpath(os.path.join(rel, d))))]
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./downloads:/downloads
|
- ./downloads:/downloads
|
||||||
- ./metube-config:/config
|
- ./metube-config:/config
|
||||||
# Media library for the organize/browse feature (change the host path to your real library)
|
# Media library for the organize/browse feature (change the host path to your real library)
|
||||||
- ./library:/library
|
- ./library:/library
|
||||||
# Multiple library mounts share one Library view; each mount becomes a
|
# Multiple library mounts share one Library view; each mount becomes a
|
||||||
# top-level collapsible group. Uncomment to use instead of ./library:
|
# top-level collapsible group. Uncomment to use instead of ./library:
|
||||||
# - /mnt/media-a:/media/media-a
|
- ./library/media-a:/media/media-a
|
||||||
# - /mnt/media-b:/media/media-b
|
- ./library/media-b:/media/media-b
|
||||||
# Optional: mount cookies file for authenticated downloads
|
# Optional: mount cookies file for authenticated downloads
|
||||||
# - ./cookies:/cookies:ro
|
# - ./cookies:/cookies:ro
|
||||||
environment:
|
environment:
|
||||||
# Basic configuration
|
# Basic configuration
|
||||||
- UID=0
|
- UID=0
|
||||||
|
|
@ -29,10 +29,10 @@ services:
|
||||||
- DOWNLOAD_DIR=/downloads
|
- DOWNLOAD_DIR=/downloads
|
||||||
- STATE_DIR=/config
|
- STATE_DIR=/config
|
||||||
- TEMP_DIR=/downloads
|
- TEMP_DIR=/downloads
|
||||||
# Media library (organize/browse feature); leave empty to disable
|
# Media library (organize/browse feature); leave empty to disable
|
||||||
- LIBRARY_DIR=/library
|
- LIBRARY_DIR=/library
|
||||||
# Multi-root alternative (overrides LIBRARY_DIR, comma-separated):
|
# Multi-root alternative (overrides LIBRARY_DIR, comma-separated):
|
||||||
# - LIBRARY_DIRS=/media/media-a,/media/media-b
|
- LIBRARY_DIRS=/media/media-a,/media/media-b
|
||||||
|
|
||||||
# Download behavior
|
# Download behavior
|
||||||
- DOWNLOAD_MODE=limited
|
- DOWNLOAD_MODE=limited
|
||||||
|
|
@ -117,4 +117,4 @@ services:
|
||||||
# metube-downloads:
|
# metube-downloads:
|
||||||
# driver: local
|
# driver: local
|
||||||
# metube-cookies:
|
# metube-cookies:
|
||||||
# driver: local
|
# driver: local
|
||||||
|
|
|
||||||
|
|
@ -177,12 +177,14 @@
|
||||||
background: var(--bg)
|
background: var(--bg)
|
||||||
color: var(--fg)
|
color: var(--fg)
|
||||||
|
|
||||||
svg
|
fa-icon
|
||||||
|
display: inline-block
|
||||||
font-size: 11px
|
font-size: 11px
|
||||||
|
line-height: 1
|
||||||
transition: transform 0.15s ease
|
transition: transform 0.15s ease
|
||||||
transform: rotate(90deg)
|
transform: rotate(90deg)
|
||||||
|
|
||||||
&.collapsed svg
|
&.collapsed fa-icon
|
||||||
transform: none
|
transform: none
|
||||||
|
|
||||||
.lib-group-item
|
.lib-group-item
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue