mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-20 15:02:07 +00:00
added custom buttons to backup
This commit is contained in:
parent
08b3991f5f
commit
6e9b882b83
9 changed files with 25 additions and 6 deletions
|
|
@ -211,7 +211,7 @@ class _AnimeStreamPageState extends riv.ConsumerState<AnimeStreamPage>
|
|||
if (debandingType == DebandingType.cpu) "vf": "gradfun=radius=12",
|
||||
if (debandingType == DebandingType.gpu) "deband": "yes",
|
||||
if (useYUV420P) "vf": "format=yuv420p",
|
||||
"alang": audioPreferredLang,
|
||||
if (audioPreferredLang.isNotEmpty) "alang": audioPreferredLang,
|
||||
if (enableAudioPitchCorrection) "audio-pitch-correction": "yes",
|
||||
"volume-max": "${volumeBoostCap + 100}",
|
||||
if (audioChannel != AudioChannel.reverseStereo)
|
||||
|
|
|
|||
|
|
@ -222,6 +222,7 @@ List<(String, int)> _getSettingsList(BuildContext context) {
|
|||
final l10n = context.l10n;
|
||||
return [
|
||||
(l10n.app_settings, 6),
|
||||
(l10n.custom_buttons, 10),
|
||||
(l10n.sources_settings, 7),
|
||||
(l10n.include_sensitive_settings, 8),
|
||||
];
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class BackupFrequencyOptionsState extends _$BackupFrequencyOptionsState {
|
|||
@override
|
||||
List<int> build() {
|
||||
return isar.settings.getSync(227)!.backupListOptions ??
|
||||
[0, 1, 2, 3, 4, 5, 6, 7];
|
||||
[0, 1, 2, 3, 4, 5, 6, 7, 10];
|
||||
}
|
||||
|
||||
void set(List<int> values) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ final backupFrequencyStateProvider =
|
|||
|
||||
typedef _$BackupFrequencyState = AutoDisposeNotifier<int>;
|
||||
String _$backupFrequencyOptionsStateHash() =>
|
||||
r'477541f3b59fe662ea3471400ff62066ea7e2196';
|
||||
r'9aa31bef65e0e2f20b306ed17ff058df2f24a635';
|
||||
|
||||
/// See also [BackupFrequencyOptionsState].
|
||||
@ProviderFor(BackupFrequencyOptionsState)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import 'package:mangayomi/eval/model/source_preference.dart';
|
|||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/category.dart';
|
||||
import 'package:mangayomi/models/chapter.dart';
|
||||
import 'package:mangayomi/models/custom_button.dart';
|
||||
import 'package:mangayomi/models/download.dart';
|
||||
import 'package:mangayomi/models/history.dart';
|
||||
import 'package:mangayomi/models/manga.dart';
|
||||
|
|
@ -131,6 +132,15 @@ Future<void> doBackUp(
|
|||
.toList();
|
||||
datas.addAll({"extensions": res});
|
||||
}
|
||||
if (list.contains(10)) {
|
||||
final res = isar.customButtons
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.findAllSync()
|
||||
.map((e) => e.toJson())
|
||||
.toList();
|
||||
datas.addAll({"customButtons": res});
|
||||
}
|
||||
final regExp = RegExp(r'[^a-zA-Z0-9 .()\-\s]');
|
||||
final name =
|
||||
'mangayomi_${DateTime.now().toString().replaceAll(regExp, '_').replaceAll(' ', '_')}';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'backup.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$doBackUpHash() => r'ad907e7ff4cd9f05bb3fa2da0fd1a1f1d2c23258';
|
||||
String _$doBackUpHash() => r'a570fe00421ee352ea170440ce27b258cf9ddc15';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:mangayomi/eval/model/source_preference.dart';
|
|||
import 'package:mangayomi/main.dart';
|
||||
import 'package:mangayomi/models/category.dart';
|
||||
import 'package:mangayomi/models/chapter.dart';
|
||||
import 'package:mangayomi/models/custom_button.dart';
|
||||
import 'package:mangayomi/models/download.dart';
|
||||
import 'package:mangayomi/models/update.dart';
|
||||
import 'package:mangayomi/models/history.dart';
|
||||
|
|
@ -155,6 +156,9 @@ void restoreBackup(Ref ref, Map<String, dynamic> backup, {bool full = true}) {
|
|||
final updates = (backup["updates"] as List?)
|
||||
?.map((e) => Update.fromJson(e))
|
||||
.toList();
|
||||
final customButtons = (backup["customButtons"] as List?)
|
||||
?.map((e) => CustomButton.fromJson(e))
|
||||
.toList();
|
||||
|
||||
isar.writeTxnSync(() {
|
||||
isar.mangas.clearSync();
|
||||
|
|
@ -245,6 +249,10 @@ void restoreBackup(Ref ref, Map<String, dynamic> backup, {bool full = true}) {
|
|||
if (settings != null) {
|
||||
isar.settings.putAllSync(settings);
|
||||
}
|
||||
isar.customButtons.clearSync();
|
||||
if (customButtons != null) {
|
||||
isar.customButtons.putAllSync(customButtons);
|
||||
}
|
||||
_invalidateCommonState(ref);
|
||||
ref.read(routerCurrentLocationStateProvider.notifier).refresh();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class _DoRestoreProviderElement extends AutoDisposeProviderElement<void>
|
|||
BuildContext get context => (origin as DoRestoreProvider).context;
|
||||
}
|
||||
|
||||
String _$restoreBackupHash() => r'2f440cfc5359e15bfd3887d27b38ecaf881404c6';
|
||||
String _$restoreBackupHash() => r'0dc4d911f0b84fd7fa30acf690799b196db4de6e';
|
||||
|
||||
/// See also [restoreBackup].
|
||||
@ProviderFor(restoreBackup)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'myanimelist.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$myAnimeListHash() => r'a612e9ce814268ac79dc86d810ca6bd3671812e6';
|
||||
String _$myAnimeListHash() => r'4391ad9446d14b1fb1ffdfbc5323ef04db5140f7';
|
||||
|
||||
/// Copied from Dart SDK
|
||||
class _SystemHash {
|
||||
|
|
|
|||
Loading…
Reference in a new issue