Skip to content

Commit be008e0

Browse files
Fix DVD extraction path error on Windows root drives, bump to 0.9.3
Path::file_name() returns None for Windows root paths like "D:\", causing the full path (including colon) to be embedded in the temp filename. Strip illegal characters in both the Rust worker and Dart UI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b7e56ee commit be008e0

6 files changed

Lines changed: 19 additions & 10 deletions

File tree

app/lib/viewmodels/main_viewmodel.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,10 +1223,12 @@ class MainViewModel extends ChangeNotifier {
12231223
int? startChapter,
12241224
int? endChapter,
12251225
}) async {
1226-
// Create temp file for the extraction
1226+
// Create temp file for the extraction.
1227+
// Sanitize volume label to remove characters illegal in filenames (e.g., ":" from "D:\").
1228+
final safeLabel = dvdInfo.volumeLabel.replaceAll(RegExp(r'[\\/:*?"<>|]'), '_');
12271229
final tempDir = Directory.systemTemp;
12281230
final tempFile = File(
1229-
'${tempDir.path}/vapourbox_dvd_${dvdInfo.volumeLabel}_t${titleIndex}_${DateTime.now().millisecondsSinceEpoch}.mpg',
1231+
'${tempDir.path}/vapourbox_dvd_${safeLabel}_t${titleIndex}_${DateTime.now().millisecondsSinceEpoch}.mpg',
12301232
);
12311233

12321234
final dvdSourceInfo = DvdSourceInfo(

app/macos/Runner/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.9.2</string>
20+
<string>0.9.3</string>
2121
<key>CFBundleVersion</key>
22-
<string>0.9.2</string>
22+
<string>0.9.3</string>
2323
<key>LSMinimumSystemVersion</key>
2424
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2525
<key>NSHumanReadableCopyright</key>

app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: vapourbox
22
description: "Video processing and cleanup powered by VapourSynth"
33
publish_to: 'none'
4-
version: 0.9.2+18
4+
version: 0.9.3+19
55

66
environment:
77
sdk: ^3.6.2

app/windows/runner/Runner.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ IDI_APP_ICON ICON "resources\\app_icon.ico"
7373
#endif
7474

7575
VS_VERSION_INFO VERSIONINFO
76-
FILEVERSION 0,9,2,0
77-
PRODUCTVERSION 0,9,2,0
76+
FILEVERSION 0,9,3,0
77+
PRODUCTVERSION 0,9,3,0
7878
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
7979
#ifdef _DEBUG
8080
FILEFLAGS VS_FF_DEBUG

worker/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vapourbox-worker"
3-
version = "0.9.2"
3+
version = "0.9.3"
44
edition = "2021"
55
description = "Video processing worker using VapourSynth"
66
authors = ["Stuart Cameron"]

worker/src/dvd_reader.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,18 @@ fn find_ifo_file(video_ts_dir: &Path, filename: &str) -> Result<PathBuf> {
286286
pub fn enumerate_titles(device_path: &str) -> Result<DvdInfo> {
287287
let video_ts_dir = find_video_ts_dir(device_path)?;
288288

289-
// Derive volume label from path
289+
// Derive volume label from path.
290+
// On Windows, Path::file_name() returns None for root paths like "D:\",
291+
// so fall back to the drive letter (strip trailing `:\`).
290292
let volume_label = Path::new(device_path)
291293
.file_name()
292294
.map(|n| n.to_string_lossy().to_string())
293-
.unwrap_or_else(|| device_path.to_string());
295+
.unwrap_or_else(|| {
296+
device_path
297+
.trim_end_matches(['\\', '/'])
298+
.trim_end_matches(':')
299+
.to_string()
300+
});
294301

295302
// Read VIDEO_TS.IFO
296303
let vmg_ifo_path = find_ifo_file(&video_ts_dir, "VIDEO_TS.IFO")?;

0 commit comments

Comments
 (0)