mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-07-12 16:11:34 +08:00
Merge pull request #77 from JefferyHcool/feature/regenerate
feat: 更新图片路径生成逻辑
This commit is contained in:
@@ -25,6 +25,11 @@ export default defineConfig(({ mode }) => {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => path.replace(/^\/api/, '/api'),
|
rewrite: path => path.replace(/^\/api/, '/api'),
|
||||||
},
|
},
|
||||||
|
'/static': {
|
||||||
|
target: apiBaseUrl,
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: path => path.replace(/^\/static/, '/static'),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class NoteGenerator:
|
|||||||
for idx, (marker, ts) in enumerate(matches):
|
for idx, (marker, ts) in enumerate(matches):
|
||||||
image_path = generate_screenshot(video_path, output_dir, ts, idx)
|
image_path = generate_screenshot(video_path, output_dir, ts, idx)
|
||||||
image_relative_path = os.path.join(image_base_url, os.path.basename(image_path)).replace("\\", "/")
|
image_relative_path = os.path.join(image_base_url, os.path.basename(image_path)).replace("\\", "/")
|
||||||
image_url = f"{BACKEND_BASE_URL.rstrip('/')}/{image_relative_path.lstrip('/')}"
|
image_url = f"/static/screenshots/{os.path.basename(image_path)}"
|
||||||
replacement = f""
|
replacement = f""
|
||||||
new_markdown = new_markdown.replace(marker, replacement, 1)
|
new_markdown = new_markdown.replace(marker, replacement, 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user