Skip to content

Commit

Permalink
feat!: 漫画、小说支持
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaoMint committed Jul 19, 2023
1 parent 42b4da3 commit 9a0a07e
Show file tree
Hide file tree
Showing 42 changed files with 1,771 additions and 651 deletions.
72 changes: 34 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,41 @@ jobs:
artifacts: "build/app/outputs/flutter-apk/app-*.apk"
allowUpdates: true

build-and-release-linux:
runs-on: ubuntu-latest
# build-and-release-linux:
# runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.10.3
channel: stable
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable linux build
run: flutter config --enable-linux-desktop
- name: Build artifacts
run: flutter build linux --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: Miru-${{github.ref_name}}-linux.zip
directory: build/linux/x64/release/bundle
# 发布安装包
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: "build/linux/x64/release/bundle/Miru-${{github.ref_name}}-linux.zip"
- name: Release Packages
uses: ncipollo/release-action@v1
with:
artifacts: "build/linux/x64/release/bundle/Miru-${{github.ref_name}}-linux.zip"
allowUpdates: true
# steps:
# - uses: actions/checkout@v3
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: 3.10.3
# channel: stable
# - name: Install dependencies
# run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libmpv-dev mpv
# - name: Install project dependencies
# run: flutter pub get
# - name: Generate intermediates
# run: flutter pub run build_runner build --delete-conflicting-outputs
# - name: Enable linux build
# run: flutter config --enable-linux-desktop
# - name: Build artifacts
# run: flutter build linux --release
# - name: Archive Release
# uses: thedoctor0/zip-release@master
# with:
# type: "zip"
# filename: Miru-${{github.ref_name}}-linux.zip
# directory: build/linux/x64/release/bundle
# # 发布安装包
# - name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# path: "build/linux/x64/release/bundle/Miru-${{github.ref_name}}-linux.zip"
# - name: Release Packages
# uses: ncipollo/release-action@v1
# with:
# artifacts: "build/linux/x64/release/bundle/Miru-${{github.ref_name}}-linux.zip"
# allowUpdates: true

build-and-release-windows:
runs-on: windows-latest
Expand All @@ -97,10 +97,6 @@ jobs:
channel: stable
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable windows build
run: flutter config --enable-windows-desktop
- name: Build artifacts
run: flutter build windows --release
- name: Archive Release
Expand Down
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,34 @@ Miru App

- [x] Windows 支持
- [x] Android 支持
- [x] Linux 支持
- [x] ~~Linux 支持~~
- [ ] 字幕
- [ ] BT 种子播放
- [ ] 漫画支持
- [ ] 小说支持
- [x] 漫画支持
- [x] 小说支持
- [x] 影视支持
- [ ] TMDB 元数据
- [ ] 数据同步
- [x] i18n 国际化
- [x] 扩展设置
- [ ] 漫画小说视频设置
- [ ] 漫画小说历史记录
- [ ] 影视播放记录

## 截图

### Android

![Miru](assets/screenshot/miru-app.jpg.png)

### windows/linux
### Windows

![Miru](assets/screenshot/miru-desktop.jpg.png)

## 关于 Linux

目前 Linux 因为依赖问题导致无法启动 quickjs 所以暂时不支持了

## 交流

Telegram: https://t.me/MiruChat
Expand Down
8 changes: 5 additions & 3 deletions assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"repo": "Repository",
"unset": "Not set",
"extension-missing": "Extension {package} missing",
"error": "Error"
"error": "Error",
"retry": "Retry",
"next": "Next",
"previous": "Previous"
},

"home": {
Expand Down Expand Up @@ -46,7 +49,6 @@
"extension-repo": {
"error": "An error occurred!",
"error-tips": "Please check your network connection\nor the repository address",
"retry": "Retry",
"empty": "Repository is empty",
"upgrade": "Update"
},
Expand Down Expand Up @@ -106,7 +108,7 @@
"extension-type": {
"video": "Video",
"novel": "Novel",
"comics": "Comics"
"comic": "Comic"
},

"extension-info": {
Expand Down
8 changes: 5 additions & 3 deletions assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"repo": "仓库",
"unset": "未设置",
"extension-missing": "扩展 {package} 丢失",
"error": "错误"
"error": "错误",
"retry": "重试",
"next": "下一个",
"previous": "上一个"
},

"home": {
Expand Down Expand Up @@ -51,7 +54,6 @@
"extension-repo": {
"error": "发生错误了!",
"error-tips": "请检查网络连接或者仓库地址是否正确",
"retry": "重试",
"empty": "仓库为空",
"upgrade": "更新"
},
Expand Down Expand Up @@ -111,7 +113,7 @@
"extension-type": {
"video": "影视",
"novel": "小说",
"comics": "漫画"
"comic": "漫画"
},

"extension-info": {
Expand Down
82 changes: 1 addition & 81 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:fluent_ui/fluent_ui.dart' as fluent;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:get/get.dart';
import 'package:go_router/go_router.dart';
import 'package:media_kit/media_kit.dart';
import 'package:miru_app/pages/detail/view.dart';
import 'package:miru_app/pages/extension/view.dart';
import 'package:miru_app/pages/extension_log/view.dart';
import 'package:miru_app/pages/extension_repo/view.dart';
import 'package:miru_app/pages/extension_settings/view.dart';
import 'package:miru_app/pages/home/view.dart';
import 'package:miru_app/pages/main/view.dart';
import 'package:miru_app/pages/search/view.dart';
import 'package:miru_app/pages/settings/view.dart';
import 'package:miru_app/router/router.dart';
import 'package:miru_app/utils/extension.dart';
import 'package:miru_app/utils/i18n.dart';
import 'package:miru_app/utils/miru_storage.dart';
Expand Down Expand Up @@ -120,75 +112,3 @@ class MainApp extends StatelessWidget {
);
}
}

_animation(Widget child) {
return Animate(
child: child,
).moveY(
begin: 40,
end: 0,
curve: Curves.easeOutCubic,
);
}

final rootNavigatorKey = GlobalKey<NavigatorState>();
final _shellNavigatorKey = GlobalKey<NavigatorState>();

final router = GoRouter(
navigatorKey: rootNavigatorKey,
routes: [
ShellRoute(
navigatorKey: _shellNavigatorKey,
builder: (context, state, child) {
return DesktopMainPage(
shellContext: _shellNavigatorKey.currentContext,
state: state,
child: child,
);
},
routes: [
GoRoute(
path: '/',
builder: (context, state) => _animation(const HomePage()),
),
GoRoute(
path: '/search',
builder: (context, state) => _animation(const SearchPage()),
),
GoRoute(
path: '/extension',
builder: (context, state) => _animation(const ExtensionPage()),
),
GoRoute(
path: '/extension_settings',
builder: (context, state) => _animation(
ExtensionSettingsPage(
package: state.queryParameters['package']!,
),
),
),
GoRoute(
path: '/settings',
builder: (context, state) => _animation(const SettingsPage()),
),
GoRoute(
path: '/settings',
builder: (context, state) => _animation(const SettingsPage()),
),
GoRoute(
path: '/extension_repo',
builder: (context, state) => _animation(const ExtensionRepoPage()),
),
GoRoute(
path: '/detail',
builder: (context, state) => _animation(
DetailPage(
url: state.queryParameters['url']!,
package: state.queryParameters['package']!,
),
),
),
],
)
],
);
34 changes: 32 additions & 2 deletions lib/models/extension.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:miru_app/widgets/bangumi_card.dart';
import 'package:miru_app/widgets/extension_item_card.dart';

part 'extension.g.dart';

Expand Down Expand Up @@ -67,7 +67,7 @@ class ExtensionListItem {

Map<String, dynamic> toJson() => _$ExtensionListItemToJson(this);

map(BangumiCard Function(dynamic e) param0) {}
map(ExtensionItemCard Function(dynamic e) param0) {}
}

@JsonSerializable()
Expand Down Expand Up @@ -135,6 +135,36 @@ class ExtensionBangumiWatch {
Map<String, dynamic> toJson() => _$ExtensionBangumiWatchToJson(this);
}

@JsonSerializable()
class ExtensionMangaWatch {
final List<String> urls;
ExtensionMangaWatch({
required this.urls,
});

factory ExtensionMangaWatch.fromJson(Map<String, dynamic> json) =>
_$ExtensionMangaWatchFromJson(json);

Map<String, dynamic> toJson() => _$ExtensionMangaWatchToJson(this);
}

@JsonSerializable()
class ExtensionFikushonWatch {
final List<String> content;
final String title;
final String? subtitle;
ExtensionFikushonWatch({
required this.content,
required this.title,
this.subtitle,
});

factory ExtensionFikushonWatch.fromJson(Map<String, dynamic> json) =>
_$ExtensionFikushonWatchFromJson(json);

Map<String, dynamic> toJson() => _$ExtensionFikushonWatchToJson(this);
}

@JsonSerializable()
class ExtensionLog {
ExtensionLog({
Expand Down
28 changes: 28 additions & 0 deletions lib/models/extension.g.dart

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

4 changes: 4 additions & 0 deletions lib/models/index.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export 'extension.dart';
export 'favorite.dart';
export 'history.dart';
export 'extension_setting.dart';
Loading

0 comments on commit 9a0a07e

Please sign in to comment.