Fix dist path rename to mytube for Docker/runtime

This commit is contained in:
TonyBlu 2026-04-30 15:35:12 +08:00
parent 44c42b3773
commit d6fa81b5de
2 changed files with 4 additions and 4 deletions

View file

@ -54,7 +54,7 @@ RUN BGUTIL_TAG="$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com
rm /tmp/bgutil-ytdlp-pot-provider-rs.zip
COPY app ./app
COPY --from=builder /metube/dist/metube ./ui/dist/metube
COPY --from=builder /metube/dist/mytube ./ui/dist/mytube
ENV PUID=1000
ENV PGID=1000

View file

@ -1043,7 +1043,7 @@ def get_custom_dirs():
@routes.get(config.URL_PREFIX)
async def index(request):
response = web.FileResponse(os.path.join(config.BASE_DIR, 'ui/dist/metube/browser/index.html'))
response = web.FileResponse(os.path.join(config.BASE_DIR, 'ui/dist/mytube/browser/index.html'))
if 'metube_theme' not in request.cookies:
response.set_cookie('metube_theme', config.DEFAULT_THEME)
return response
@ -1076,11 +1076,11 @@ if config.URL_PREFIX != '/':
routes.static(config.URL_PREFIX + 'download/', config.DOWNLOAD_DIR, show_index=config.DOWNLOAD_DIRS_INDEXABLE)
routes.static(config.URL_PREFIX + 'audio_download/', config.AUDIO_DOWNLOAD_DIR, show_index=config.DOWNLOAD_DIRS_INDEXABLE)
routes.static(config.URL_PREFIX, os.path.join(config.BASE_DIR, 'ui/dist/metube/browser'))
routes.static(config.URL_PREFIX, os.path.join(config.BASE_DIR, 'ui/dist/mytube/browser'))
try:
app.add_routes(routes)
except ValueError as e:
if 'ui/dist/metube/browser' in str(e):
if 'ui/dist/mytube/browser' in str(e):
raise RuntimeError('Could not find the frontend UI static assets. Please run `node_modules/.bin/ng build` inside the ui folder') from e
raise e