Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Aug 16, 2023
2 parents 7aac487 + 3b7b270 commit 75674c6
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 41 deletions.
26 changes: 25 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path/path.dart' as path;
import 'package:path_provider/path_provider.dart';
import 'package:shared_preferences/shared_preferences.dart';

Expand All @@ -21,7 +24,28 @@ Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final packageInfo = await PackageInfo.fromPlatform();
final sharedPreferences = await SharedPreferences.getInstance();
var appDirectory = (kIsWeb) ? null : await getApplicationDocumentsDirectory();

Directory? appDirectory;
if (!kIsWeb) {
final appDocDirectory = await getApplicationDocumentsDirectory();
appDirectory = Directory(path.join(appDocDirectory.path, 'Sorayomi'));

await appDirectory.create(recursive: true);

final cacheFiles = ['dio_cache.hive', 'dio_cache.lock'];
for (final cacheFile in cacheFiles) {
final oldCacheFilePath = path.join(appDocDirectory.path, cacheFile);
final newCacheFilePath = path.join(appDirectory.path, cacheFile);

if (!(await File(newCacheFilePath).exists()) &&
await File(oldCacheFilePath).exists()) {
await File(oldCacheFilePath).rename(newCacheFilePath);
}
}
} else {
appDirectory = null;
}

SystemChrome.setPreferredOrientations(DeviceOrientation.values);
GoRouter.optionURLReflectsImperativeAPIs = true;

Expand Down
28 changes: 14 additions & 14 deletions lib/src/routes/router_config.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 25 additions & 25 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: "9d6445da1caf8412070670c03c39ad5b12a78cc8c2361417b220905a2bcbdd2f"
sha256: ce75a1b40947fea0a0e16ce73337122a86762e38b982e1ccb909daa3b9bc4197
url: "https://pub.dev"
source: hosted
version: "5.3.1"
version: "5.3.2"
dio_cache_interceptor:
dependency: "direct main"
description:
Expand Down Expand Up @@ -317,10 +317,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
version: "2.1.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -505,10 +505,10 @@ packages:
dependency: "direct dev"
description:
name: go_router_builder
sha256: df2034629637d0c7c380aba5daa2f91be4733f2d632e7dff0b082d5ff3155068
sha256: "3e7e0ca431abd9089ff82113d8c8790ba2114ff8e3690d40c4fd38394374474d"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
version: "2.3.0"
graphs:
dependency: transitive
description:
Expand Down Expand Up @@ -673,10 +673,10 @@ packages:
dependency: "direct main"
description:
name: network_info_plus
sha256: "5a79c244070fb7f7d10fbcfa24eed315252b4e662f42658029871d31afdbba9e"
sha256: c0113bfd4276be3fe4ba56aeb2792d780df9f3f62aaa4afdd1cdf716b8e29545
url: "https://pub.dev"
source: hosted
version: "4.0.1"
version: "4.0.2"
network_info_plus_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -713,10 +713,10 @@ packages:
dependency: "direct main"
description:
name: package_info_plus
sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b
sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.1.0"
package_info_plus_platform_interface:
dependency: transitive
description:
Expand All @@ -726,7 +726,7 @@ packages:
source: hosted
version: "2.0.1"
path:
dependency: transitive
dependency: "direct main"
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
Expand All @@ -737,34 +737,34 @@ packages:
dependency: "direct main"
description:
name: path_provider
sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2"
sha256: "909b84830485dbcd0308edf6f7368bc8fd76afa26a270420f34cabea2a6467a0"
url: "https://pub.dev"
source: hosted
version: "2.0.15"
version: "2.1.0"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86"
sha256: "5d44fc3314d969b84816b569070d7ace0f1dea04bd94a83f74c4829615d22ad8"
url: "https://pub.dev"
source: hosted
version: "2.0.27"
version: "2.1.0"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297"
sha256: "1b744d3d774e5a879bb76d6cd1ecee2ba2c6960c03b1020cd35212f6aa267ac5"
url: "https://pub.dev"
source: hosted
version: "2.2.4"
version: "2.3.0"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57
sha256: ba2b77f0c52a33db09fc8caf85b12df691bf28d983e84cf87ff6d693cfa007b3
url: "https://pub.dev"
source: hosted
version: "2.1.11"
version: "2.2.0"
path_provider_platform_interface:
dependency: transitive
description:
Expand All @@ -777,10 +777,10 @@ packages:
dependency: transitive
description:
name: path_provider_windows
sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96"
sha256: ee0e0d164516b90ae1f970bdf29f726f1aa730d7cfc449ecc74c495378b705da
url: "https://pub.dev"
source: hosted
version: "2.1.7"
version: "2.2.0"
permission_handler:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1166,10 +1166,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af"
sha256: "3dd2388cc0c42912eee04434531a26a82512b9cb1827e0214430c9bcbddfe025"
url: "https://pub.dev"
source: hosted
version: "6.0.37"
version: "6.0.38"
url_launcher_ios:
dependency: transitive
description:
Expand Down Expand Up @@ -1262,10 +1262,10 @@ packages:
dependency: transitive
description:
name: xdg_directories
sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff
sha256: f0c26453a2d47aa4c2570c6a033246a3fc62da2fe23c7ffdd0a7495086dc0247
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.0.2"
xml:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: tachidesk_sorayomi
description: A new Flutter frontend for Tachidesk.

publish_to: "none"
version: 0.5.9+1
version: 0.5.10+1

environment:
sdk: ">=3.0.0 <4.0.0"
Expand Down Expand Up @@ -31,6 +31,7 @@ dependencies:
json_annotation: ^4.8.1
network_info_plus: ^4.0.0
package_info_plus: ^4.0.0
path: ^1.8.3
path_provider: ^2.0.11
permission_handler: ^10.2.0
pub_semver: ^2.1.2
Expand Down

0 comments on commit 75674c6

Please sign in to comment.