mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +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,
|
||||
),
|
||||
);
|
||||
final name =
|
||||
String name =
|
||||
'${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(
|
||||
name: name,
|
||||
bytes: bytes,
|
||||
|
||||
Reference in New Issue
Block a user