mirror of
https://github.com/stonega/tsacdop
synced 2025-02-03 08:57:33 +01:00
Disable group manage when import ompl.
Improve import ompl group support.
This commit is contained in:
parent
1d7d772323
commit
bd297c3c90
@ -59,6 +59,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts> {
|
||||
final s = context.s;
|
||||
return Consumer<GroupList>(builder: (_, groupList, __) {
|
||||
var groups = groupList.groups;
|
||||
bool import = groupList.created;
|
||||
bool isLoading = groupList.isLoading;
|
||||
return isLoading
|
||||
? Container(
|
||||
@ -127,24 +128,26 @@ class _ScrollPodcastsState extends State<ScrollPodcasts> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideLeftRoute(
|
||||
page: PodcastManage()),
|
||||
);
|
||||
if (!import)
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideLeftRoute(
|
||||
page: PodcastManage()),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 30,
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Text(
|
||||
s.homeGroupsSeeAll,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.accentColor),
|
||||
)),
|
||||
height: 30,
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Text(
|
||||
s.homeGroupsSeeAll,
|
||||
style: context.textTheme.bodyText1
|
||||
.copyWith(
|
||||
color: import
|
||||
? context
|
||||
.primaryColorDark
|
||||
: context.accentColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -245,9 +248,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts> {
|
||||
horizontal: 15.0),
|
||||
child: Text(
|
||||
groups[_groupIndex].name,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
style: context.textTheme.bodyText1
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.accentColor),
|
||||
@ -260,23 +261,25 @@ class _ScrollPodcastsState extends State<ScrollPodcasts> {
|
||||
alignment: Alignment.bottomRight,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideLeftRoute(page: PodcastManage()),
|
||||
);
|
||||
if (!import)
|
||||
Navigator.push(
|
||||
context,
|
||||
SlideLeftRoute(
|
||||
page: PodcastManage()),
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
height: 30,
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Text(
|
||||
s.homeGroupsSeeAll,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
.copyWith(
|
||||
color: Theme.of(context)
|
||||
.accentColor),
|
||||
)),
|
||||
height: 30,
|
||||
padding: EdgeInsets.all(5.0),
|
||||
child: Text(
|
||||
s.homeGroupsSeeAll,
|
||||
style: context.textTheme.bodyText1
|
||||
.copyWith(
|
||||
color: import
|
||||
? context.primaryColorDark
|
||||
: context.accentColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -294,8 +297,7 @@ class _ScrollPodcastsState extends State<ScrollPodcasts> {
|
||||
left: 6.0,
|
||||
right: 6.0),
|
||||
indicator: CircleTabIndicator(
|
||||
color: Theme.of(context).accentColor,
|
||||
radius: 3),
|
||||
color: context.accentColor, radius: 3),
|
||||
isScrollable: true,
|
||||
tabs: groups[_groupIndex]
|
||||
.podcasts
|
||||
|
@ -151,11 +151,12 @@ class DBHelper {
|
||||
[boo ? 1 : 0, id]);
|
||||
}
|
||||
|
||||
Future<bool> checkPodcast(String url) async {
|
||||
Future<String> checkPodcast(String url) async {
|
||||
var dbClient = await database;
|
||||
List<Map> list = await dbClient
|
||||
.rawQuery('SELECT id FROM PodcastLocal WHERE rssUrl = ?', [url]);
|
||||
return list.length == 0;
|
||||
if (list.isEmpty) return '';
|
||||
return list.first['id'];
|
||||
}
|
||||
|
||||
Future savePodcastLocal(PodcastLocal podcastLocal) async {
|
||||
|
@ -444,9 +444,10 @@ Future<void> subIsolateEntryPoint(SendPort sendPort) async {
|
||||
String realUrl =
|
||||
response.redirects.isEmpty ? rss : response.realUri.toString();
|
||||
|
||||
bool checkUrl = await dbHelper.checkPodcast(realUrl);
|
||||
String checkUrl = await dbHelper.checkPodcast(realUrl);
|
||||
|
||||
if (checkUrl) {
|
||||
/// If url not existe in database.
|
||||
if (checkUrl == '') {
|
||||
img.Image thumbnail;
|
||||
String imageUrl;
|
||||
try {
|
||||
@ -524,7 +525,7 @@ Future<void> subIsolateEntryPoint(SendPort sendPort) async {
|
||||
} else
|
||||
sendPort.send("done");
|
||||
} else {
|
||||
sendPort.send([item.title, item.url, 5]);
|
||||
sendPort.send([item.title, realUrl, 5, checkUrl, item.group]);
|
||||
await Future.delayed(Duration(seconds: 2));
|
||||
sendPort.send([item.title, item.url, 4]);
|
||||
items.removeWhere((element) => element.url == item.url);
|
||||
|
Loading…
x
Reference in New Issue
Block a user