Bump deps and improve error hande
This commit is contained in:
parent
9ff8f84892
commit
f14f0f819c
|
@ -6,7 +6,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.2'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||||
#distributionSha256Sum=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821
|
#distributionSha256Sum=abc10bcedb58806e8654210f96031db541bcd2d6fc3161e81cb0572d6a15e821
|
||||||
|
|
|
@ -197,16 +197,20 @@ class DiscoveryPageState extends State<DiscoveryPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<OnlinePodcast>> _getTopPodcasts({int page}) async {
|
Future<List<OnlinePodcast>> _getTopPodcasts({int page}) async {
|
||||||
if(environment['apiKey'] == '') return [];
|
if (environment['apiKey'] == '') return [];
|
||||||
final searchEngine = ListenNotesSearch();
|
final searchEngine = ListenNotesSearch();
|
||||||
var searchResult = await searchEngine.fetchBestPodcast(
|
try {
|
||||||
genre: '',
|
var searchResult = await searchEngine.fetchBestPodcast(
|
||||||
page: page,
|
genre: '',
|
||||||
);
|
page: page,
|
||||||
final podcastTopList =
|
);
|
||||||
searchResult.podcasts.map((e) => e?.toOnlinePodcast).toList();
|
final podcastTopList =
|
||||||
_podcastList.addAll(podcastTopList.cast());
|
searchResult.podcasts.map((e) => e?.toOnlinePodcast).toList();
|
||||||
return _podcastList;
|
_podcastList.addAll(podcastTopList.cast());
|
||||||
|
return _podcastList;
|
||||||
|
} catch (e) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> _getHideDiscovery() async {
|
Future<bool> _getHideDiscovery() async {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:tsacdop/util/cache_manager.dart';
|
||||||
import 'package:webfeed/webfeed.dart';
|
import 'package:webfeed/webfeed.dart';
|
||||||
|
|
||||||
import '../.env.dart';
|
import '../.env.dart';
|
||||||
|
@ -251,6 +252,7 @@ class _RssResultState extends State<RssResult> {
|
||||||
CachedNetworkImage(
|
CachedNetworkImage(
|
||||||
height: 120.0,
|
height: 120.0,
|
||||||
width: 120.0,
|
width: 120.0,
|
||||||
|
cacheManager: CustomCacheManager(),
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
imageUrl: _onlinePodcast.image,
|
imageUrl: _onlinePodcast.image,
|
||||||
|
@ -1356,6 +1358,7 @@ class PodcastAvatar extends StatelessWidget {
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
imageUrl: podcast.image,
|
imageUrl: podcast.image,
|
||||||
|
cacheManager: CustomCacheManager(),
|
||||||
placeholderFadeInDuration: Duration.zero,
|
placeholderFadeInDuration: Duration.zero,
|
||||||
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
||||||
Container(
|
Container(
|
||||||
|
|
|
@ -952,15 +952,14 @@ class __NewPlaylistState extends State<_NewPlaylist> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<EpisodeBrief> _getEpisodeFromFile(String path) async {
|
Future<EpisodeBrief> _getEpisodeFromFile(String path) async {
|
||||||
var metadataRetriever = MetadataRetriever();
|
|
||||||
final fileLength = File(path).statSync().size;
|
final fileLength = File(path).statSync().size;
|
||||||
final pubDate = DateTime.now().millisecondsSinceEpoch;
|
final pubDate = DateTime.now().millisecondsSinceEpoch;
|
||||||
var primaryColor;
|
var primaryColor;
|
||||||
var imagePath;
|
var imagePath;
|
||||||
await metadataRetriever.setFile(File(path));
|
var metadata = await MetadataRetriever.fromFile(File(path));
|
||||||
if (metadataRetriever.albumArt != null) {
|
if (metadata.albumArt != null) {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
final image = img.decodeImage(metadataRetriever.albumArt);
|
final image = img.decodeImage(metadata.albumArt);
|
||||||
final thumbnail = img.copyResize(image, width: 300);
|
final thumbnail = img.copyResize(image, width: 300);
|
||||||
var uuid = Uuid().v4();
|
var uuid = Uuid().v4();
|
||||||
File("${dir.path}/$uuid.png")..writeAsBytesSync(img.encodePng(thumbnail));
|
File("${dir.path}/$uuid.png")..writeAsBytesSync(img.encodePng(thumbnail));
|
||||||
|
@ -968,7 +967,6 @@ class __NewPlaylistState extends State<_NewPlaylist> {
|
||||||
primaryColor = await _getColor(File(imagePath));
|
primaryColor = await _getColor(File(imagePath));
|
||||||
}
|
}
|
||||||
final fileName = path.split('/').last;
|
final fileName = path.split('/').last;
|
||||||
final metadata = await metadataRetriever.metadata;
|
|
||||||
return EpisodeBrief(
|
return EpisodeBrief(
|
||||||
fileName,
|
fileName,
|
||||||
'file://$path',
|
'file://$path',
|
||||||
|
|
|
@ -31,13 +31,15 @@ class Gpodder {
|
||||||
|
|
||||||
Future<void> _initDio() async {
|
Future<void> _initDio() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
_dio.interceptors.add(CookieManager(cookieJar));
|
_dio.interceptors.add(CookieManager(cookieJar));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> login({String username, String password}) async {
|
Future<int> login({String username, String password}) async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
cookieJar.delete(Uri.parse(_baseUrl));
|
cookieJar.delete(Uri.parse(_baseUrl));
|
||||||
_dio.interceptors.add(CookieManager(cookieJar));
|
_dio.interceptors.add(CookieManager(cookieJar));
|
||||||
final basicAuth =
|
final basicAuth =
|
||||||
|
@ -81,7 +83,8 @@ class Gpodder {
|
||||||
|
|
||||||
Future<void> _initService() async {
|
Future<void> _initService() async {
|
||||||
final dir = await getApplicationDocumentsDirectory();
|
final dir = await getApplicationDocumentsDirectory();
|
||||||
var cookieJar = PersistCookieJar(dir: "${dir.path}/.cookies/");
|
var cookieJar =
|
||||||
|
PersistCookieJar(storage: FileStorage("${dir.path}/.cookies/"));
|
||||||
cookieJar.delete(Uri.parse(_baseUrl));
|
cookieJar.delete(Uri.parse(_baseUrl));
|
||||||
await _storage.clearList();
|
await _storage.clearList();
|
||||||
await _addStorage.clearList();
|
await _addStorage.clearList();
|
||||||
|
|
|
@ -441,7 +441,7 @@ class HistoryChart extends StatelessWidget {
|
||||||
titlesData: FlTitlesData(
|
titlesData: FlTitlesData(
|
||||||
show: true,
|
show: true,
|
||||||
bottomTitles: SideTitles(
|
bottomTitles: SideTitles(
|
||||||
getTextStyles: (i) => TextStyle(
|
getTextStyles: (_, i) => TextStyle(
|
||||||
color: const Color(0xff67727d),
|
color: const Color(0xff67727d),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
@ -456,7 +456,7 @@ class HistoryChart extends StatelessWidget {
|
||||||
),
|
),
|
||||||
leftTitles: SideTitles(
|
leftTitles: SideTitles(
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
getTextStyles: (s) => TextStyle(
|
getTextStyles: (_, s) => TextStyle(
|
||||||
color: const Color(0xff67727d),
|
color: const Color(0xff67727d),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
|
|
|
@ -977,8 +977,7 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
MediaItem get currentMediaItem => mediaItem.value;
|
MediaItem get currentMediaItem => mediaItem.value;
|
||||||
bool get playing => playbackState.value.playing;
|
bool get playing => playbackState.value.playing;
|
||||||
|
|
||||||
BehaviorSubject<Map<String, dynamic>> customEvent =
|
PublishSubject<Map<String, dynamic>> customEvent = PublishSubject()..add({});
|
||||||
BehaviorSubject.seeded({});
|
|
||||||
|
|
||||||
CustomAudioHandler(int cacheMax) {
|
CustomAudioHandler(int cacheMax) {
|
||||||
_player.cacheMax = cacheMax;
|
_player.cacheMax = cacheMax;
|
||||||
|
@ -990,7 +989,6 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
mediaItem.add(queue.value[index]);
|
mediaItem.add(queue.value[index]);
|
||||||
}
|
}
|
||||||
if (_isQueue && index == 1) {
|
if (_isQueue && index == 1) {
|
||||||
|
|
||||||
customEvent.add({'removePlayed': queue.value.first.title});
|
customEvent.add({'removePlayed': queue.value.first.title});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1197,7 +1195,7 @@ class CustomAudioHandler extends BaseAudioHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future customAction(funtion, argument) async {
|
Future<dynamic> customAction(funtion, [argument]) async {
|
||||||
switch (funtion) {
|
switch (funtion) {
|
||||||
case 'stopAtEnd':
|
case 'stopAtEnd':
|
||||||
_stopAtEnd = true;
|
_stopAtEnd = true;
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||||
|
|
||||||
|
/// The DefaultCacheManager that can be easily used directly. The code of
|
||||||
|
/// this implementation can be used as inspiration for more complex cache
|
||||||
|
/// managers.
|
||||||
|
|
||||||
|
class CustomCacheManager extends CacheManager with ImageCacheManager {
|
||||||
|
static const key = 'libCachedImageData';
|
||||||
|
|
||||||
|
static final CustomCacheManager _instance = CustomCacheManager._();
|
||||||
|
factory CustomCacheManager() {
|
||||||
|
return _instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<FileInfo> downloadFile(String url,
|
||||||
|
{String key, Map<String, String> authHeaders, bool force = false}) async {
|
||||||
|
var file;
|
||||||
|
try {
|
||||||
|
file = await super
|
||||||
|
.downloadFile(url, key: key, authHeaders: authHeaders, force: force);
|
||||||
|
} catch (e) {}
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
CustomCacheManager._() : super(Config(key));
|
||||||
|
}
|
37
pubspec.yaml
37
pubspec.yaml
|
@ -13,30 +13,30 @@ dependencies:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
auto_animated: ^3.0.0
|
auto_animated: ^3.0.0
|
||||||
audio_session: ^0.1.0
|
audio_session: ^0.1.0
|
||||||
cached_network_image: ^3.0.0
|
cached_network_image: ^3.1.0
|
||||||
color_thief_flutter: ^1.0.2
|
color_thief_flutter: ^1.0.2
|
||||||
confetti: ^0.5.5
|
confetti: ^0.5.5
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
connectivity: ^3.0.3
|
connectivity: ^3.0.3
|
||||||
crypto: ^3.0.1
|
crypto: ^3.0.1
|
||||||
device_info: ^2.0.0
|
device_info: ^2.0.2
|
||||||
dio_cookie_manager: ^1.0.0
|
dio_cookie_manager: ^2.0.0
|
||||||
dio: ^3.0.10
|
dio: ^4.0.0
|
||||||
extended_nested_scroll_view: ^3.0.0
|
extended_nested_scroll_view: ^3.0.0
|
||||||
effective_dart: ^1.3.1
|
effective_dart: ^1.3.1
|
||||||
feature_discovery: ^0.14.0
|
feature_discovery: ^0.14.0
|
||||||
file_picker: ^3.0.1
|
file_picker: ^3.0.1
|
||||||
flutter_html: ^0.11.1
|
flutter_html: 0.11.1
|
||||||
fluttertoast: ^4.0.1
|
fluttertoast: ^4.0.1
|
||||||
flutter_isolate: ^2.0.0
|
flutter_isolate: ^2.0.0
|
||||||
flutter_linkify: ^4.1.0
|
flutter_linkify: ^4.1.0
|
||||||
flutter_file_dialog: ^2.0.0
|
flutter_file_dialog: ^2.1.1
|
||||||
flare_flutter: ^3.0.0
|
flare_flutter: ^3.0.2
|
||||||
fl_chart: ^0.12.2
|
fl_chart: ^0.36.4
|
||||||
line_icons: ^2.0.1
|
line_icons: ^2.0.1
|
||||||
flutter_media_metadata: ^0.1.0
|
flutter_media_metadata: ^0.1.1
|
||||||
marquee: ^2.0.0
|
marquee: ^2.0.0
|
||||||
google_fonts: ^2.0.0
|
google_fonts: ^2.1.0
|
||||||
image: ^3.0.2
|
image: ^3.0.2
|
||||||
intl: ^0.17.0
|
intl: ^0.17.0
|
||||||
json_serializable: ^4.1.0
|
json_serializable: ^4.1.0
|
||||||
|
@ -47,15 +47,17 @@ dependencies:
|
||||||
state_notifier: ^0.7.0
|
state_notifier: ^0.7.0
|
||||||
tuple: ^2.0.0
|
tuple: ^2.0.0
|
||||||
url_launcher: ^6.0.3
|
url_launcher: ^6.0.3
|
||||||
|
uuid: ^3.0.4
|
||||||
workmanager: ^0.2.3
|
workmanager: ^0.2.3
|
||||||
wc_flutter_share: ^0.4.0
|
wc_flutter_share: ^0.4.0
|
||||||
|
xml: ^5.2.0
|
||||||
just_audio:
|
just_audio:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/just_audio_origin.git
|
url: https://github.com/stonega/just_audio_origin.git
|
||||||
ref: update
|
ref: update
|
||||||
path: just_audio
|
path: just_audio
|
||||||
audio_service:
|
audio_service:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/ryanheise/audio_service.git
|
url: https://github.com/ryanheise/audio_service.git
|
||||||
ref: one-isolate
|
ref: one-isolate
|
||||||
path: audio_service
|
path: audio_service
|
||||||
|
@ -68,20 +70,13 @@ dependencies:
|
||||||
webfeed:
|
webfeed:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/webfeed.git
|
url: https://github.com/stonega/webfeed.git
|
||||||
|
|
||||||
dependency_overrides:
|
|
||||||
equatable: ^2.0.0
|
equatable: ^2.0.0
|
||||||
path_provider: ^2.0.1
|
path_provider: ^2.0.1
|
||||||
http_parser: ^4.0.0
|
http_parser: ^4.0.0
|
||||||
cookie_jar: ^2.0.0
|
|
||||||
uuid: ^3.0.1
|
dependency_overrides:
|
||||||
http: ^0.13.0
|
meta: 1.3.0
|
||||||
flutter_cache_manager: ^3.0.1
|
|
||||||
rxdart: ^0.26.0
|
|
||||||
shared_preferences: 2.0.0
|
shared_preferences: 2.0.0
|
||||||
plugin_platform_interface: ^2.0.0
|
|
||||||
convert: ^3.0.0
|
|
||||||
xml: ^5.0.2
|
|
||||||
linkify:
|
linkify:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/stonega/linkify.git
|
url: https://github.com/stonega/linkify.git
|
||||||
|
|
Loading…
Reference in New Issue