mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
fix save subtitle on win
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1136,8 +1136,15 @@ class HeaderControlState extends State<HeaderControl> {
|
|||||||
res.headers.map,
|
res.headers.map,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final name =
|
String name =
|
||||||
'${introController.videoDetail.value.title}-${videoDetailCtr.bvid}-${videoDetailCtr.cid.value}-${item.lanDoc}.json';
|
'${introController.videoDetail.value.title}-${videoDetailCtr.bvid}-${videoDetailCtr.cid.value}-${item.lanDoc}.json';
|
||||||
|
if (Platform.isWindows) {
|
||||||
|
// Reserved characters may not be used in file names. See: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
|
||||||
|
name = name.replaceAll(
|
||||||
|
RegExp(r'[<>:/\\|?*"]'),
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
}
|
||||||
Utils.saveBytes2File(
|
Utils.saveBytes2File(
|
||||||
name: name,
|
name: name,
|
||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
|
|||||||
Reference in New Issue
Block a user