mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-29 15:28:48 +02:00
fix(convert): simplify output names and harden writes
This commit is contained in:
@@ -335,14 +335,12 @@ String normalizedConvertedAudioFormat(String targetFormat) {
|
||||
String convertedOutputFileName({
|
||||
required String originalFileName,
|
||||
required String targetFormat,
|
||||
required bool keepOriginal,
|
||||
}) {
|
||||
final dotIndex = originalFileName.lastIndexOf('.');
|
||||
final baseName = dotIndex > 0
|
||||
? originalFileName.substring(0, dotIndex)
|
||||
: originalFileName;
|
||||
final suffix = keepOriginal ? '_converted' : '';
|
||||
return '$baseName$suffix${convertTargetExtAndMime(targetFormat).ext}';
|
||||
return '$baseName${convertTargetExtAndMime(targetFormat).ext}';
|
||||
}
|
||||
|
||||
String convertedLibraryItemId(String sourceId, String filePath) {
|
||||
|
||||
Reference in New Issue
Block a user