mirror of
https://github.com/stonega/tsacdop
synced 2025-02-18 04:20:37 +01:00
Bug fix
- subscribe error if episode have none duration - isolate bug
This commit is contained in:
parent
5f75ace725
commit
8ef189626f
@ -18,6 +18,6 @@ jobs:
|
||||
- run: dart tool/env.dart
|
||||
- run:
|
||||
name: Build the Android version
|
||||
command: flutter build apk --split-per-abi --no-shrink
|
||||
command: flutter build appbundle --no-shrink
|
||||
- store_artifacts:
|
||||
path: build/app/outputs/
|
@ -47,7 +47,7 @@ android {
|
||||
applicationId "com.stonegate.tsacdop"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
versionCode 9
|
||||
versionCode 10
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
1
lib/class/settingstate.dart
Normal file
1
lib/class/settingstate.dart
Normal file
@ -0,0 +1 @@
|
||||
export '../state/settingstate.dart';
|
@ -4,7 +4,7 @@ import 'package:tsacdop/util/custompaint.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'package:line_icons/line_icons.dart';
|
||||
|
||||
const String version = '0.2.2';
|
||||
const String version = '0.2.3';
|
||||
|
||||
class AboutApp extends StatelessWidget {
|
||||
_launchUrl(String url) async {
|
||||
|
@ -254,11 +254,9 @@ class _SearchResultState extends State<SearchResult>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// var importOmpl = Provider.of<ImportOmpl>(context, listen: false);
|
||||
// var groupList = Provider.of<GroupList>(context, listen: false);
|
||||
var subscribeWorker = Provider.of<SubscribeWorker>(context, listen: false);
|
||||
|
||||
savePodcast(OnlinePodcast podcast) async {
|
||||
savePodcast(OnlinePodcast podcast) {
|
||||
SubscribeItem item = SubscribeItem(podcast.rss, podcast.title, imgUrl: podcast.image);
|
||||
subscribeWorker.setSubscribeItem(item);
|
||||
}
|
||||
@ -310,9 +308,9 @@ class _SearchResultState extends State<SearchResult>
|
||||
height: 35,
|
||||
child: !_issubscribe
|
||||
? OutlineButton(
|
||||
highlightedBorderColor: Theme.of(context).accentColor,
|
||||
highlightedBorderColor: context.accentColor,
|
||||
splashColor:
|
||||
Theme.of(context).accentColor.withOpacity(0.8),
|
||||
context.accentColor.withOpacity(0.8),
|
||||
child: Text('Subscribe',
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).accentColor)),
|
||||
|
@ -820,7 +820,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
|
||||
}
|
||||
|
||||
@override
|
||||
void onCustomAction(funtion, argument) async {
|
||||
Future onCustomAction(funtion, argument) async {
|
||||
switch (funtion) {
|
||||
case 'stopAtEnd':
|
||||
_stopAtEnd = true;
|
||||
|
@ -46,8 +46,6 @@ ThemeData lightTheme = ThemeData(
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
class SettingState extends ChangeNotifier {
|
||||
KeyValueStorage themeStorage = KeyValueStorage(themesKey);
|
||||
KeyValueStorage accentStorage = KeyValueStorage(accentsKey);
|
||||
|
@ -59,15 +59,17 @@ class SubscribeWorker extends ChangeNotifier {
|
||||
receivePort.distinct().listen((message) {
|
||||
if (message is SendPort) {
|
||||
subSendPort = message;
|
||||
subSendPort.send([_subscribeItem.url, _subscribeItem.title, _subscribeItem.imgUrl]);
|
||||
subSendPort.send(
|
||||
[_subscribeItem.url, _subscribeItem.title, _subscribeItem.imgUrl]);
|
||||
} else if (message is List) {
|
||||
_setCurrentSubscribeItem(SubscribeItem(message[1], message[0],
|
||||
subscribeState: SubscribeState.values[message[2]],
|
||||
id: message.length == 4 ? message[3] : ''));
|
||||
print(message[2]);
|
||||
} else if (message is String && message == "done") {
|
||||
subIsolate?.kill();
|
||||
subIsolate.kill();
|
||||
subIsolate = null;
|
||||
_currentSubscribeItem = SubscribeItem('', '');
|
||||
_created = false;
|
||||
}
|
||||
});
|
||||
@ -79,7 +81,8 @@ class SubscribeWorker extends ChangeNotifier {
|
||||
_created = true;
|
||||
listen();
|
||||
} else
|
||||
subSendPort.send([_subscribeItem.url, _subscribeItem.title, _subscribeItem.imgUrl]);
|
||||
subSendPort.send(
|
||||
[_subscribeItem.url, _subscribeItem.title, _subscribeItem.imgUrl]);
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
@ -114,7 +117,6 @@ Future<void> subIsolateEntryPoint(SendPort sendPort) async {
|
||||
print(rss);
|
||||
try {
|
||||
Response response = await Dio(options).get(rss);
|
||||
|
||||
var p = RssFeed.parse(response.data);
|
||||
|
||||
var dir = await getApplicationDocumentsDirectory();
|
||||
|
@ -69,13 +69,18 @@ Duration parseDuration(String s) {
|
||||
var minutes = 0;
|
||||
var seconds = 0;
|
||||
var parts = s.split(':');
|
||||
if (parts.length > 2) {
|
||||
hours = int.parse(parts[parts.length - 3]);
|
||||
try {
|
||||
if (parts.length > 2) {
|
||||
hours = int.parse(parts[parts.length - 3]);
|
||||
}
|
||||
if (parts.length > 1) {
|
||||
minutes = int.parse(parts[parts.length - 2]);
|
||||
}
|
||||
seconds = int.parse(parts[parts.length - 1]);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
if (parts.length > 1) {
|
||||
minutes = int.parse(parts[parts.length - 2]);
|
||||
}
|
||||
seconds = int.parse(parts[parts.length - 1]);
|
||||
|
||||
return Duration(
|
||||
hours: hours,
|
||||
minutes: minutes,
|
||||
|
23
pubspec.yaml
23
pubspec.yaml
@ -1,7 +1,7 @@
|
||||
name: tsacdop
|
||||
description: An easy-use podacasts player.
|
||||
|
||||
version: 0.2.2
|
||||
version: 0.2.3
|
||||
|
||||
environment:
|
||||
sdk: ">=2.6.0 <3.0.0"
|
||||
@ -20,7 +20,7 @@ dev_dependencies:
|
||||
flutter_html: ^0.11.1
|
||||
path_provider: ^1.6.7
|
||||
color_thief_flutter: ^1.0.2
|
||||
provider: ^4.0.5
|
||||
provider: ^4.1.0
|
||||
google_fonts: ^1.0.0
|
||||
dio: ^3.0.9
|
||||
file_picker: ^1.6.3+1
|
||||
@ -39,21 +39,22 @@ dev_dependencies:
|
||||
workmanager: ^0.2.2
|
||||
flutter_colorpicker: ^0.3.4
|
||||
fl_chart: ^0.9.3
|
||||
audio_service: ^0.7.2
|
||||
just_audio:
|
||||
git:
|
||||
url: https://github.com/stonega/just_audio.git
|
||||
line_icons:
|
||||
git:
|
||||
url: https://github.com/galonsos/line_icons.git
|
||||
audio_service: ^0.8.0
|
||||
flutter_file_dialog: ^0.0.5
|
||||
flutter_linkify: ^3.1.2
|
||||
extended_nested_scroll_view: ^0.4.0
|
||||
connectivity: ^0.4.8+2
|
||||
flare_flutter: ^2.0.3
|
||||
rxdart: ^0.24.0
|
||||
flutter_isolate: ^1.0.0+11
|
||||
auto_animated: ^2.0.2
|
||||
auto_animated: ^2.0.2
|
||||
just_audio:
|
||||
git:
|
||||
url: https://github.com/stonega/just_audio.git
|
||||
line_icons:
|
||||
git:
|
||||
url: https://github.com/galonsos/line_icons.git
|
||||
dependency_overrides:
|
||||
flutter_isolate: '1.0.0+11'
|
||||
|
||||
|
||||
flutter:
|
||||
|
Loading…
x
Reference in New Issue
Block a user