multiple inconsistencies fixed (AI)
This commit is contained in:
@@ -64,11 +64,47 @@ export class ExFATFilesystem extends BaseFilesystem {
|
||||
if (variantId !== 'exfat') return;
|
||||
|
||||
const values = this.getInputValues(variantId);
|
||||
|
||||
// Validate input ranges
|
||||
const validation = this.validateFilesystemSpecific(variantId, values);
|
||||
if (!validation.valid) {
|
||||
console.warn('exFAT validation errors:', validation.errors);
|
||||
}
|
||||
|
||||
const results = {};
|
||||
|
||||
this.calculateExFAT(values, results);
|
||||
}
|
||||
|
||||
validateFilesystemSpecific(variantId, values) {
|
||||
if (variantId !== 'exfat') return { valid: true, errors: [] };
|
||||
|
||||
const errors = [];
|
||||
|
||||
// Validate cluster number is reasonable
|
||||
if (values.clusterNumberExfat !== undefined && values.clusterNumberExfat < 2) {
|
||||
errors.push('clusterNumberExfat: Cluster-Nummer muss >= 2 sein');
|
||||
}
|
||||
|
||||
// Validate sector and cluster size exponents
|
||||
if (values.sectorSizeExfat !== undefined) {
|
||||
if (values.sectorSizeExfat < 0 || values.sectorSizeExfat > 15) {
|
||||
errors.push('sectorSizeExfat: Exponent muss zwischen 0 und 15 liegen');
|
||||
}
|
||||
}
|
||||
|
||||
if (values.clusterSizeSectorsExfat !== undefined) {
|
||||
if (values.clusterSizeSectorsExfat < 0 || values.clusterSizeSectorsExfat > 25) {
|
||||
errors.push('clusterSizeSectorsExfat: Exponent muss zwischen 0 und 25 liegen');
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
valid: errors.length === 0,
|
||||
errors: errors
|
||||
};
|
||||
}
|
||||
|
||||
calculateExFAT(values, results) {
|
||||
// Calculate actual sector size from 2^n
|
||||
const sectorSize = Math.pow(2, values.sectorSizeExfat);
|
||||
|
||||
Reference in New Issue
Block a user