Skip to content

Commit

Permalink
Merge pull request #23 from harlanx:bugfix/closing-takes-too-long
Browse files Browse the repository at this point in the history
fix: Closing window takes too long
  • Loading branch information
harlanx committed Aug 20, 2023
2 parents ba15c5e + 43f997e commit 1a0fe25
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions inno_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ DisableProgramGroupPage=yes
OutputDir={#SourcePath}\build\windows\runner\Outputs
OutputBaseFilename=mkv_profile-{#MyAppVersion}-setup-windows
SetupIconFile={#SourcePath}\windows\runner\resources\app_icon.ico
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallDisplayName={#MyAppName}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Expand Down
1 change: 0 additions & 1 deletion lib/data/app_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class AppData {
try {
final miw = MediaInfoWrapper(dllPath: file.path);
final result = miw.option('Info_Version');
// ignore: sdk_version_since
miw.library.close();
if (result.isNotEmpty && result.contains('MediaInfoLib')) {
mediaInfoLoaded = true;
Expand Down
3 changes: 2 additions & 1 deletion lib/data/app_settings_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class AppSettingsNotifier extends ChangeNotifier {
}

Future<void> save() async {
await SharedPrefs.setString('AppSettings', jsonEncode(this));
final toBeSaved = jsonEncode(this);
await SharedPrefs.setString('AppSettings', toBeSaved);
}

void setRecursiveLimit(int limit) {
Expand Down
4 changes: 2 additions & 2 deletions lib/data/output_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class OutputNotifier extends ChangeNotifier {
}

Future<void> save() async {
final tobeSaved = _items.values.map((e) => jsonEncode(e)).toList();
await SharedPrefs.setStringList('Outputs', tobeSaved);
final toBeSaved = _items.values.map((e) => jsonEncode(e)).toList();
await SharedPrefs.setStringList('Outputs', toBeSaved);
}

void add(List<OutputBasic> outputResults) {
Expand Down
6 changes: 2 additions & 4 deletions lib/data/user_profiles_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@ class UserProfilesNotifier extends ChangeNotifier {
}

Future<void> save() async {
await SharedPrefs.setStringList(
'UserProfiles',
_items.values.map((e) => jsonEncode(e)).toList(),
);
final toBeSaved = _items.values.map((e) => jsonEncode(e)).toList();
await SharedPrefs.setStringList('UserProfiles', toBeSaved);
}

Future<void> import(String path) async {
Expand Down
1 change: 0 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void main() async {
// Causes app frame freeze on hot reload or hot restart so don't await this one.
unawaited(
windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.setPreventClose(true);
if (AppData.appSettings.isMaximized) {
await windowManager.maximize();
}
Expand Down
5 changes: 5 additions & 0 deletions lib/screens/home/home_screen_dialogs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ class _VideoTitleDialogState extends State<VideoTitleDialog> {
inputFormatters: [
FilteringTextInputFormatter.singleLineFormatter,
],
onChanged: (value) {
if (sameAsOutput.value) {
trackTitleCtrl.text = fileTitleCtrl.text;
}
},
validator: (value) {
if (value != null) {
if (value.isEmpty) {
Expand Down
1 change: 0 additions & 1 deletion lib/services/metadata_scanner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class MetadataScanner {

// We need to unload of the dll since it can be changed in the settings on runtime.
static void unload() {
// ignore: sdk_version_since
_miw.library.close();
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -883,5 +883,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ description: Automatically manage and mux series or movie files to the common co
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 0.6.3+22
version: 0.6.4+23

environment:
sdk: '>=3.0.0 <4.0.0'
sdk: '>=3.1.0 <4.0.0'

dependencies:
flutter:
Expand Down

0 comments on commit 1a0fe25

Please sign in to comment.