feat: replace custom FFmpeg AAR with ffmpeg_kit_flutter plugin, add Lossy format support (MP3/Opus)

- Replace custom ffmpeg-kit-with-lame.aar with ffmpeg_kit_flutter_new_audio plugin
- Rename MP3 option to Lossy with format selection (MP3 320kbps or Opus 128kbps)
- Add convertFlacToOpus() and convertFlacToLossy() functions in FFmpegService
- Update settings model: enableMp3Option -> enableLossyOption, add lossyFormat field
- Update download_queue_provider to use LOSSY quality with format from settings
- Remove FFMPEG_CHANNEL MethodChannel from MainActivity.kt
- Delete custom FFmpeg AAR files from android/app/libs/
- Add new localization strings for lossy format options
This commit is contained in:
zarzet
2026-01-31 08:03:38 +07:00
parent 6c832d1754
commit 518a7fd2cf
28 changed files with 583 additions and 222 deletions
+8 -4
View File
@@ -31,7 +31,8 @@ class AppSettings {
final String albumFolderStructure;
final bool showExtensionStore;
final String locale;
final bool enableMp3Option;
final bool enableLossyOption;
final String lossyFormat;
final String lyricsMode;
const AppSettings({
@@ -62,7 +63,8 @@ class AppSettings {
this.albumFolderStructure = 'artist_album',
this.showExtensionStore = true,
this.locale = 'system',
this.enableMp3Option = false,
this.enableLossyOption = false,
this.lossyFormat = 'mp3',
this.lyricsMode = 'embed',
});
@@ -95,7 +97,8 @@ class AppSettings {
String? albumFolderStructure,
bool? showExtensionStore,
String? locale,
bool? enableMp3Option,
bool? enableLossyOption,
String? lossyFormat,
String? lyricsMode,
}) {
return AppSettings(
@@ -126,7 +129,8 @@ class AppSettings {
albumFolderStructure: albumFolderStructure ?? this.albumFolderStructure,
showExtensionStore: showExtensionStore ?? this.showExtensionStore,
locale: locale ?? this.locale,
enableMp3Option: enableMp3Option ?? this.enableMp3Option,
enableLossyOption: enableLossyOption ?? this.enableLossyOption,
lossyFormat: lossyFormat ?? this.lossyFormat,
lyricsMode: lyricsMode ?? this.lyricsMode,
);
}
+4 -2
View File
@@ -36,7 +36,8 @@ AppSettings _$AppSettingsFromJson(Map<String, dynamic> json) => AppSettings(
json['albumFolderStructure'] as String? ?? 'artist_album',
showExtensionStore: json['showExtensionStore'] as bool? ?? true,
locale: json['locale'] as String? ?? 'system',
enableMp3Option: json['enableMp3Option'] as bool? ?? false,
enableLossyOption: json['enableLossyOption'] as bool? ?? false,
lossyFormat: json['lossyFormat'] as String? ?? 'mp3',
lyricsMode: json['lyricsMode'] as String? ?? 'embed',
);
@@ -69,6 +70,7 @@ Map<String, dynamic> _$AppSettingsToJson(AppSettings instance) =>
'albumFolderStructure': instance.albumFolderStructure,
'showExtensionStore': instance.showExtensionStore,
'locale': instance.locale,
'enableMp3Option': instance.enableMp3Option,
'enableLossyOption': instance.enableLossyOption,
'lossyFormat': instance.lossyFormat,
'lyricsMode': instance.lyricsMode,
};