Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrew-cask-action #166

Merged
merged 4 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,20 @@ jobs:
needs: create-build
runs-on: windows-latest # action can only be run on windows
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
- name: Update WINGET manifest
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: Suwayomi.Tachidesk-Sorayomi
version: ${{ github.ref_name }}
token: ${{ secrets.WINGET }}
token: ${{ secrets.WINGET }}

homebrew-cask-publish:
needs: create-build
runs-on: macos-latest
steps:
- name: Update Homebrew cask
uses: macauley/action-homebrew-bump-cask@v1
with:
token: ${{secrets.WINGET}}
tap: homebrew/homebrew-cask
cask: tachidesk-sorayomi
22 changes: 11 additions & 11 deletions lib/src/constants/endpoints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ abstract class CategoryUrl {

abstract class MangaUrl {
static String withId(int mangaId) => "$_manga/$mangaId";
static String fullWithId(String mangaId) => "$_manga/$mangaId/full";
static String fullWithId(int mangaId) => "$_manga/$mangaId/full";
static String thumbnail(int mangaId) => "$_manga/$mangaId/thumbnail";
static String category(String mangaId) => "$_manga/$mangaId/category";
static String categoryId(String mangaId, String categoryId) =>
static String category(int mangaId) => "$_manga/$mangaId/category";
static String categoryId(int mangaId, String categoryId) =>
"$_manga/$mangaId/category/$categoryId";
static String library(String mangaId) => "$_manga/$mangaId/library";
static String meta(String mangaId) => "$_manga/$mangaId/meta";
static String chapters(String mangaId) => "$_manga/$mangaId/chapters";
static String library(int mangaId) => "$_manga/$mangaId/library";
static String meta(int mangaId) => "$_manga/$mangaId/meta";
static String chapters(int mangaId) => "$_manga/$mangaId/chapters";
static String chapterWithIndex(
String mangaId,
String chapterIndex,
int mangaId,
int chapterIndex,
) =>
"$_manga/$mangaId/chapter/$chapterIndex";
static String chapterMetaWithIndex(int mangaId, int chapterIndex) =>
"$_manga/$mangaId/chapter/$chapterIndex/meta";
static String chapterBatch = "/chapter/batch";
static String chapterPageWithIndex({
required String mangaId,
required String chapterIndex,
required String pageIndex,
required int mangaId,
required int chapterIndex,
required int pageIndex,
}) =>
"$_manga/$mangaId/chapter/$chapterIndex/page/$pageIndex";

Expand Down
24 changes: 12 additions & 12 deletions lib/src/constants/navigation_bar_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import '../utils/extensions/custom_extensions.dart';

class NavigationBarData {
final String Function(BuildContext context) label;
final String path;
final ValueSetter<BuildContext> go;
final IconData icon;
final IconData activeIcon;
final List<String> activeOn;
Expand All @@ -27,42 +27,42 @@ class NavigationBarData {
icon: Icons.collections_bookmark_outlined,
activeIcon: Icons.collections_bookmark_rounded,
label: (context) => context.l10n!.library,
path: Routes.library,
activeOn: [Routes.library],
go: const LibraryRoute().go,
activeOn: [const LibraryRoute().location],
),
NavigationBarData(
icon: Icons.new_releases_outlined,
activeIcon: Icons.new_releases_rounded,
label: (context) => context.l10n!.updates,
path: Routes.updates,
activeOn: [Routes.updates],
go: const UpdatesRoute().go,
activeOn: [const UpdatesRoute().location],
),
NavigationBarData(
icon: Icons.explore_outlined,
activeIcon: Icons.explore_rounded,
label: (context) => context.l10n!.browse,
path: Routes.browse,
activeOn: [Routes.browse],
go: const BrowseRoute().go,
activeOn: [const BrowseRoute().location],
),
NavigationBarData(
icon: Icons.download_outlined,
activeIcon: Icons.download_rounded,
label: (context) => context.l10n!.downloads,
path: Routes.downloads,
activeOn: [Routes.downloads],
go: const DownloadsRoute().go,
activeOn: [const DownloadsRoute().location],
),
NavigationBarData(
icon: Icons.more_horiz_outlined,
activeIcon: Icons.more_horiz_rounded,
label: (context) => context.l10n!.more,
path: Routes.more,
activeOn: [Routes.more, Routes.settings],
go: const MoreRoute().go,
activeOn: [const MoreRoute().location, const SettingsRoute().location],
),
];

NavigationBarData({
required this.label,
required this.path,
required this.go,
required this.icon,
required this.activeIcon,
required this.activeOn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../constants/app_sizes.dart';
Expand Down Expand Up @@ -77,7 +76,7 @@ class BrowseScreen extends HookConsumerWidget {
key: const ValueKey(0),
onSubmitted: (value) {
if (value.isNotBlank) {
context.push(Routes.getGlobalSearch(value));
GlobalSearchRoute(query: value).push(context);
}
},
onClose: () => showSearch.value = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../../constants/app_sizes.dart';
Expand Down Expand Up @@ -41,13 +40,11 @@ class SourceQuickSearch extends ConsumerWidget {
ListTile(
title: Text(data?.displayName ?? data?.name ?? ""),
trailing: const Icon(Icons.arrow_forward_rounded),
onTap: () => context.push(
Routes.getSourceManga(
sourceId,
SourceType.filter,
query: query,
),
),
onTap: () => SourceMangaRoute(
sourceId: sourceId,
sourceType: SourceType.filter,
query: query,
).push(context),
),
mangaList.showUiWhenData(
context,
Expand All @@ -68,7 +65,8 @@ class SourceQuickSearch extends ConsumerWidget {
manga: i,
showDarkOverlay: i.inLibrary.ifNull(),
onPressed: i.id != null
? () => context.push(Routes.getManga(i.id!))
? () =>
MangaRoute(mangaId: i.id!).push(context)
: null,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../../constants/enum.dart';
Expand All @@ -27,10 +26,10 @@ class SourceListTile extends ConsumerWidget {
onTap: (() async {
if (source.id == null) return;
ref.read(sourceLastUsedProvider.notifier).update(source.id);
context.push(Routes.getSourceManga(
source.id!,
SourceType.popular,
));
SourceMangaRoute(
sourceId: source.id!,
sourceType: SourceType.popular,
).push(context);
}),
leading: ClipRRect(
borderRadius: BorderRadius.circular(8),
Expand All @@ -47,10 +46,10 @@ class SourceListTile extends ConsumerWidget {
? TextButton(
onPressed: () async {
ref.read(sourceLastUsedProvider.notifier).update(source.id);
context.push(Routes.getSourceManga(
source.id!,
SourceType.latest,
));
SourceMangaRoute(
sourceId: source.id!,
sourceType: SourceType.latest,
).push(context);
},
child: Text(context.l10n!.latest),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,11 @@ class SourceMangaListScreen extends HookConsumerWidget {
ref.read(provider.notifier).updateFilter(value);
controller.refresh();
} else {
context.pushReplacement(
Routes.getSourceManga(sourceId, SourceType.filter),
extra: value,
);
SourceMangaRoute(
sourceId: sourceId,
sourceType: SourceType.filter,
$extra: value,
).pushReplacement(context);
}
},
);
Expand Down Expand Up @@ -154,9 +155,10 @@ class SourceMangaListScreen extends HookConsumerWidget {
groupValue: sourceType,
onSelected: (val) {
if (sourceType == SourceType.popular) return;
context.pushReplacement(
Routes.getSourceManga(sourceId, SourceType.popular),
);
SourceMangaRoute(
sourceId: sourceId,
sourceType: SourceType.popular,
).pushReplacement(context);
},
),
if ((data?.supportsLatest).ifNull())
Expand All @@ -165,9 +167,10 @@ class SourceMangaListScreen extends HookConsumerWidget {
groupValue: sourceType,
onSelected: (val) {
if (sourceType == SourceType.latest) return;
context.pushReplacement(
Routes.getSourceManga(sourceId, SourceType.latest),
);
SourceMangaRoute(
sourceId: sourceId,
sourceType: SourceType.latest,
).pushReplacement(context);
},
),
Builder(
Expand Down Expand Up @@ -205,13 +208,11 @@ class SourceMangaListScreen extends HookConsumerWidget {
controller.refresh();
} else {
if (val == null) return;
context.pushReplacement(
Routes.getSourceManga(
sourceId,
SourceType.filter,
query: val,
),
);
SourceMangaRoute(
sourceId: sourceId,
sourceType: SourceType.filter,
query: val,
).pushReplacement(context);
}
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';

Expand Down Expand Up @@ -47,7 +46,7 @@ class SourceMangaGridView extends ConsumerWidget {
showDarkOverlay: item.inLibrary.ifNull(),
onPressed: () {
if (item.id != null) {
context.push(Routes.getManga(item.id!));
MangaRoute(mangaId: item.id!).push(context);
}
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:infinite_scroll_pagination/infinite_scroll_pagination.dart';

import '../../../../../routes/router_config.dart';
Expand Down Expand Up @@ -42,7 +41,7 @@ class SourceMangaListView extends StatelessWidget {
manga: item.copyWith(source: source),
onPressed: () {
if (item.id != null) {
context.push(Routes.getManga(item.id!));
MangaRoute(mangaId: item.id!).push(context);
}
},
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';

import '../../../../constants/app_sizes.dart';
Expand Down Expand Up @@ -61,7 +60,7 @@ class CategoryMangaList extends HookConsumerWidget {
await showDialog(
context: context,
builder: (context) => EditMangaCategoryDialog(
mangaId: "${data[index].id}",
mangaId: data[index].id!,
title: data[index].title,
),
);
Expand All @@ -71,10 +70,10 @@ class CategoryMangaList extends HookConsumerWidget {
manga: data![index],
onPressed: () {
if (data[index].id != null) {
context.push(Routes.getManga(
data[index].id!,
MangaRoute(
mangaId: data[index].id!,
categoryId: categoryId,
));
).push(context);
}
},
showCountBadges: true,
Expand All @@ -89,18 +88,18 @@ class CategoryMangaList extends HookConsumerWidget {
manga: data![index],
onPressed: () {
if (data[index].id != null) {
context.push(Routes.getManga(
data[index].id!,
MangaRoute(
mangaId: data[index].id!,
categoryId: categoryId,
));
).push(context);
}
},
onLongPress: () async {
if (data[index].id != null) {
await showDialog(
context: context,
builder: (context) => EditMangaCategoryDialog(
mangaId: "${data[index].id}",
mangaId: data[index].id!,
title: data[index].title,
),
);
Expand All @@ -118,18 +117,18 @@ class CategoryMangaList extends HookConsumerWidget {
manga: data![index],
onPressed: () {
if (data[index].id != null) {
context.push(Routes.getManga(
data[index].id!,
MangaRoute(
mangaId: data[index].id!,
categoryId: categoryId,
));
).push(context);
}
},
onLongPress: () async {
if (data[index].id != null) {
await showDialog(
context: context,
builder: (context) => EditMangaCategoryDialog(
mangaId: "${data[index].id}",
mangaId: data[index].id!,
title: data[index].title,
),
);
Expand Down
Loading