mirror of
https://github.com/lqtmcstudio/QZMusic_PC.git
synced 2026-08-19 02:43:23 +08:00
- 将AMLL Clone到本以地进行修复和优化(emm虽然这很不优雅但是暂时无时间做子模块和Fork) - 修复在当前播放歌词行不可见的视口Seek会出现滚动偏移的问题
24 lines
1014 B
Diff
24 lines
1014 B
Diff
diff --git a/utils/createPathFormatter.ts b/utils/createPathFormatter.ts
|
|
index 52c9527c6d8c6756125c2f746cf14d055ed1e3ef..b7c950190142168447bf3cc2d0c65a306965ac98 100644
|
|
--- a/utils/createPathFormatter.ts
|
|
+++ b/utils/createPathFormatter.ts
|
|
@@ -37,7 +37,8 @@ function formatPath(
|
|
href: string,
|
|
{ format = 'directory', trailingSlash = 'ignore' }: FormatPathOptions
|
|
) {
|
|
- const formatStrategy = formatStrategies[format];
|
|
+ const useCleanFileUrls = format === 'file' && trailingSlash === 'never';
|
|
+ const formatStrategy = useCleanFileUrls ? defaultFormatStrategy : formatStrategies[format];
|
|
const trailingSlashStrategy = trailingSlashStrategies[trailingSlash];
|
|
|
|
// Handle extension
|
|
@@ -47,7 +48,7 @@ function formatPath(
|
|
href = formatStrategy.addBase(href);
|
|
|
|
// Skip trailing slash handling for `build.format: 'file'`
|
|
- if (format === 'file') return href;
|
|
+ if (format === 'file' && !useCleanFileUrls) return href;
|
|
|
|
// Handle trailing slash
|
|
href = href === '/' ? href : trailingSlashStrategy(href);
|