mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: macOS folder permissions (#435)
This commit is contained in:
parent
9daf1831d5
commit
23385d8e62
4 changed files with 80 additions and 42 deletions
|
|
@ -265,36 +265,44 @@ class SyncNotifier extends StateNotifier<SyncSettingsModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> addSyncItem(BuildContext? context, ItemBaseModel item) async {
|
Future<void> addSyncItem(BuildContext? context, ItemBaseModel item) async {
|
||||||
if (context == null) return;
|
try {
|
||||||
|
if (context == null) return;
|
||||||
|
|
||||||
if (saveDirectory == null) {
|
if (saveDirectory == null) {
|
||||||
String? selectedDirectory =
|
String? selectedDirectory =
|
||||||
await FilePicker.platform.getDirectoryPath(dialogTitle: context.localized.syncSelectDownloadsFolder);
|
await FilePicker.platform.getDirectoryPath(dialogTitle: context.localized.syncSelectDownloadsFolder);
|
||||||
if (selectedDirectory?.isEmpty == true && context.mounted) {
|
if (selectedDirectory?.isEmpty == true && context.mounted) {
|
||||||
fladderSnackbar(context, title: context.localized.syncNoFolderSetup);
|
fladderSnackbar(context, title: context.localized.syncNoFolderSetup);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
ref.read(clientSettingsProvider.notifier).setSyncPath(selectedDirectory);
|
||||||
}
|
}
|
||||||
ref.read(clientSettingsProvider.notifier).setSyncPath(selectedDirectory);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
fladderSnackbar(context, title: context.localized.syncAddItemForSyncing(item.detailedName(context) ?? "Unknown"));
|
fladderSnackbar(context,
|
||||||
}
|
title: context.localized.syncAddItemForSyncing(item.detailedName(context) ?? "Unknown"));
|
||||||
final newSync = switch (item) {
|
}
|
||||||
EpisodeModel episode => await syncSeries(item.parentBaseModel, episode: episode),
|
final newSync = switch (item) {
|
||||||
SeasonModel season => await syncSeries(item.parentBaseModel, season: season),
|
EpisodeModel episode => await syncSeries(item.parentBaseModel, episode: episode),
|
||||||
SeriesModel series => await syncSeries(series),
|
SeasonModel season => await syncSeries(item.parentBaseModel, season: season),
|
||||||
MovieModel movie => await syncMovie(movie),
|
SeriesModel series => await syncSeries(series),
|
||||||
_ => null
|
MovieModel movie => await syncMovie(movie),
|
||||||
};
|
_ => null
|
||||||
if (context.mounted) {
|
};
|
||||||
fladderSnackbar(context,
|
if (context.mounted) {
|
||||||
title: newSync != null
|
fladderSnackbar(context,
|
||||||
? context.localized.startedSyncingItem(item.detailedName(context) ?? "Unknown")
|
title: newSync != null
|
||||||
: context.localized.unableToSyncItem(item.detailedName(context) ?? "Unknown"));
|
? context.localized.startedSyncingItem(item.detailedName(context) ?? "Unknown")
|
||||||
}
|
: context.localized.unableToSyncItem(item.detailedName(context) ?? "Unknown"));
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
} catch (e) {
|
||||||
|
log('Error adding sync item: ${e.toString()}');
|
||||||
|
if (context?.mounted == true) {
|
||||||
|
fladderSnackbar(context!, title: context.localized.somethingWentWrong);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void viewDatabase(BuildContext context) =>
|
void viewDatabase(BuildContext context) =>
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
|
||||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,26 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.cs.allow-jit</key>
|
<key>com.apple.security.assets.movies.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.server</key>
|
<key>com.apple.security.assets.music.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.assets.pictures.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.downloads.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.personal-information.location</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,24 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.client</key>
|
<key>com.apple.security.assets.movies.read-write</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
<key>com.apple.security.assets.music.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.assets.pictures.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.downloads.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.personal-information.location</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue