diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e5ce19..5b0600d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # Tsacdop Changelog ## v0.3.4 +Release date 2020/6/16 ### New feature -- Support auto donwload new episodes, you can choose which podcast you want to auto download, you can also set if download using cellular data. -- Support costomize episode popup menu, you can add options you most want, **Like** | **Mark Listened** | **Download** newly added. +- Support auto download new episodes, you can choose which podcast you want to auto download, you can also set if download using cellular data. +- Support auto delete downloaded episode, you can set days before delete. +- Support customize episode popup menu, you can add options you most want, **Like** | **Mark Listened** | **Download** newly added. - Improved downloaded file manager, you can now sort downloads by date or size, you can also only view listened downloads. ### Minor UI change - Removed the listened indicator, increased the color difference for listened episodes. @@ -12,3 +14,5 @@ ### Bugs fixed - Auto play when receive notification. - Lose podcast when import OMPL file. +### Other +- Add privacy policy. diff --git a/assets/buymeacoffee.png b/assets/buymeacoffee.png new file mode 100644 index 0000000..a5efbd0 Binary files /dev/null and b/assets/buymeacoffee.png differ diff --git a/lib/home/about.dart b/lib/home/about.dart index a18a86e..177bdd9 100644 --- a/lib/home/about.dart +++ b/lib/home/about.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:tsacdop/util/custompaint.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:line_icons/line_icons.dart'; import '../util/context_extension.dart'; -const String version = '0.3.4'; +const String version = '0.3.5'; class AboutApp extends StatelessWidget { _launchUrl(String url) async { @@ -85,7 +86,7 @@ class AboutApp extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Container( - height: 200.0, + height: 100.0, alignment: Alignment.center, child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -100,7 +101,7 @@ class AboutApp extends StatelessWidget { ), ), Padding( - padding: EdgeInsets.symmetric(horizontal: 50), + padding: const EdgeInsets.all(20), child: Text( 'Tsacdop is a podcast player developed in flutter, a clean, simply beautiful and friendly app.', textAlign: TextAlign.center, @@ -117,6 +118,7 @@ class AboutApp extends StatelessWidget { style: TextStyle(color: context.accentColor)), ), Container( + margin: const EdgeInsets.symmetric(horizontal: 5), height: 4, width: 4, decoration: BoxDecoration( @@ -126,7 +128,7 @@ class AboutApp extends StatelessWidget { FlatButton( onPressed: () => _launchUrl( 'https://tsacdop.stonegate.me/#/changelog'), - child: Text('Changelogs', + child: Text('Changelog', style: TextStyle(color: context.accentColor)), ), ], @@ -145,13 +147,45 @@ class AboutApp extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Container( + Padding( padding: EdgeInsets.symmetric(horizontal: 20.0), - alignment: Alignment.centerLeft, - child: Text( - 'Developer', - style: TextStyle( - color: Theme.of(context).accentColor), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'Developer', + style: TextStyle( + color: Theme.of(context).accentColor, fontWeight: FontWeight.bold), + ), + Spacer(), + InkWell( + onTap: () => _launchUrl( + 'https://www.buymeacoffee.com/stonegate'), + child: Container( + height: 30.0, + padding: + EdgeInsets.symmetric(horizontal: 10.0), + alignment: Alignment.centerLeft, + child: Row( + mainAxisAlignment: + MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text('Buy a coffee', + style: TextStyle( + color: context.accentColor)), + SizedBox(width: 10), + Image( + image: AssetImage( + 'assets/buymeacoffee.png'), + height: 20, + fit: BoxFit.fitHeight, + ), + ], + ), + ), + ) + ], ), ), _listItem(context, 'Twitter', LineIcons.twitter, diff --git a/lib/home/download_list.dart b/lib/home/download_list.dart index 5c283de..0103ccc 100644 --- a/lib/home/download_list.dart +++ b/lib/home/download_list.dart @@ -1,4 +1,5 @@ import 'dart:io'; +import 'package:flutter_downloader/flutter_downloader.dart'; import 'package:provider/provider.dart'; import 'package:flutter/material.dart'; @@ -28,7 +29,7 @@ Widget _downloadButton(EpisodeTask task, BuildContext context) { mainAxisSize: MainAxisSize.min, children: [ IconButton( - icon: Icon(Icons.refresh), + icon: Icon(Icons.refresh, color: Colors.red), onPressed: () => downloader.retryTask(task.episode), ), IconButton( @@ -87,7 +88,9 @@ class _DownloadListState extends State { ), Expanded( flex: 1, - child: tasks[index].progress >= 0 + child: tasks[index].progress >= 0 && + tasks[index].status != + DownloadTaskStatus.failed ? Container( width: 40.0, padding: diff --git a/lib/local_storage/sqflite_localpodcast.dart b/lib/local_storage/sqflite_localpodcast.dart index 95141f5..ce59cfb 100644 --- a/lib/local_storage/sqflite_localpodcast.dart +++ b/lib/local_storage/sqflite_localpodcast.dart @@ -218,7 +218,7 @@ class DBHelper { [id]); for (int i = 0; i < list.length; i++) { if (list[i] != null) - FlutterDownloader.remove( + await FlutterDownloader.remove( taskId: list[i]['downloaded'], shouldDeleteContent: true); print('Removed all download tasks'); } diff --git a/lib/state/download_state.dart b/lib/state/download_state.dart index a0ed344..9750ae1 100644 --- a/lib/state/download_state.dart +++ b/lib/state/download_state.dart @@ -161,8 +161,12 @@ class DownloadState extends ChangeNotifier { if (tasks.length != 0) await Future.forEach(tasks, (DownloadTask task) async { EpisodeBrief episode = await dbHelper.getRssItemWithUrl(task.url); - _episodeTasks.add(EpisodeTask(episode, task.taskId, - progress: task.progress, status: task.status)); + if (episode == null) + await FlutterDownloader.remove( + taskId: task.taskId, shouldDeleteContent: true); + else + _episodeTasks.add(EpisodeTask(episode, task.taskId, + progress: task.progress, status: task.status)); }); notifyListeners(); } @@ -221,6 +225,7 @@ class DownloadState extends ChangeNotifier { } EpisodeTask episodeToTask(EpisodeBrief episode) { + print(_episodeTasks.first.episode.description); return _episodeTasks .firstWhere((task) => task.episode.enclosureUrl == episode.enclosureUrl, orElse: () { diff --git a/pubspec.yaml b/pubspec.yaml index a57e09e..505e936 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: tsacdop description: An easy-use podacasts player. -version: 0.3.4+17 +version: 0.3.5+18 environment: sdk: ">=2.6.0 <3.0.0"