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