Fixed audio cache did't work.

This commit is contained in:
stonegate 2020-07-18 17:52:31 +08:00
parent 33e34e9966
commit 602cc67342
13 changed files with 138 additions and 61 deletions

View File

@ -1,5 +1,14 @@
# Tsacdop Changelog # Tsacdop Changelog
## v0.4.7
Release date 2020/7/18
### Bugs fixed
* Ompl files form other platform import error.
* Audio cache did't work.
## v0.4.6 ## v0.4.6
Release date 2020/7/17 Release date 2020/7/17

View File

@ -198,6 +198,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacyPolicy" : MessageLookupByLibrary.simpleMessage("Privacy Policy"), "privacyPolicy" : MessageLookupByLibrary.simpleMessage("Privacy Policy"),
"published" : m20, "published" : m20,
"recoverSubscribe" : MessageLookupByLibrary.simpleMessage("Recover subscribe"), "recoverSubscribe" : MessageLookupByLibrary.simpleMessage("Recover subscribe"),
"refreshArtwork" : MessageLookupByLibrary.simpleMessage("Update artwork"),
"remove" : MessageLookupByLibrary.simpleMessage("Remove"), "remove" : MessageLookupByLibrary.simpleMessage("Remove"),
"removeConfirm" : MessageLookupByLibrary.simpleMessage("Remove confirm"), "removeConfirm" : MessageLookupByLibrary.simpleMessage("Remove confirm"),
"removePodcastDes" : MessageLookupByLibrary.simpleMessage("Are you sure you want to unsubscribe?"), "removePodcastDes" : MessageLookupByLibrary.simpleMessage("Are you sure you want to unsubscribe?"),

View File

@ -198,6 +198,7 @@ class MessageLookup extends MessageLookupByLibrary {
"privacyPolicy" : MessageLookupByLibrary.simpleMessage("隐私条款"), "privacyPolicy" : MessageLookupByLibrary.simpleMessage("隐私条款"),
"published" : m20, "published" : m20,
"recoverSubscribe" : MessageLookupByLibrary.simpleMessage("恢复订阅"), "recoverSubscribe" : MessageLookupByLibrary.simpleMessage("恢复订阅"),
"refreshArtwork" : MessageLookupByLibrary.simpleMessage("更新头像"),
"remove" : MessageLookupByLibrary.simpleMessage("移除"), "remove" : MessageLookupByLibrary.simpleMessage("移除"),
"removeConfirm" : MessageLookupByLibrary.simpleMessage("取消订阅"), "removeConfirm" : MessageLookupByLibrary.simpleMessage("取消订阅"),
"removePodcastDes" : MessageLookupByLibrary.simpleMessage("您确认要取消订阅吗?"), "removePodcastDes" : MessageLookupByLibrary.simpleMessage("您确认要取消订阅吗?"),
@ -290,8 +291,8 @@ class MessageLookup extends MessageLookupByLibrary {
"toastRecoverFailed" : MessageLookupByLibrary.simpleMessage("恢复订阅失败"), "toastRecoverFailed" : MessageLookupByLibrary.simpleMessage("恢复订阅失败"),
"toastRemovePlaylist" : MessageLookupByLibrary.simpleMessage("从播放列表移除"), "toastRemovePlaylist" : MessageLookupByLibrary.simpleMessage("从播放列表移除"),
"toastSettingSaved" : MessageLookupByLibrary.simpleMessage("设置已保存"), "toastSettingSaved" : MessageLookupByLibrary.simpleMessage("设置已保存"),
"toastTimeEqualEnd" : MessageLookupByLibrary.simpleMessage("与结束时相同"), "toastTimeEqualEnd" : MessageLookupByLibrary.simpleMessage("与结束时相同"),
"toastTimeEqualStart" : MessageLookupByLibrary.simpleMessage("与起始时相同"), "toastTimeEqualStart" : MessageLookupByLibrary.simpleMessage("与起始时相同"),
"understood" : MessageLookupByLibrary.simpleMessage("了解"), "understood" : MessageLookupByLibrary.simpleMessage("了解"),
"undo" : MessageLookupByLibrary.simpleMessage("撤销"), "undo" : MessageLookupByLibrary.simpleMessage("撤销"),
"unlike" : MessageLookupByLibrary.simpleMessage("取消喜欢"), "unlike" : MessageLookupByLibrary.simpleMessage("取消喜欢"),

View File

@ -533,7 +533,7 @@ class S {
return Intl.message( return Intl.message(
'Rate on Play', 'Rate on Play',
name: 'feedbackPlay', name: 'feedbackPlay',
desc: '', desc: 'Rate on Google Play Store.\nUser can tap to open play link.',
args: [], args: [],
); );
} }
@ -583,7 +583,7 @@ class S {
return Intl.message( return Intl.message(
'Group existed', 'Group existed',
name: 'groupExisted', name: 'groupExisted',
desc: '', desc: 'Group name validate in add group dialog. User can\'t add group with same name.',
args: [], args: [],
); );
} }
@ -822,7 +822,7 @@ class S {
return Intl.message( return Intl.message(
'Like date', 'Like date',
name: 'likeDate', name: 'likeDate',
desc: '', desc: 'Favorite tab, sort by like date.',
args: [], args: [],
); );
} }
@ -862,7 +862,7 @@ class S {
return Intl.message( return Intl.message(
'Mark', 'Mark',
name: 'mark', name: 'mark',
desc: 'The short the best', desc: 'In listen history page, if a episode is marked as listened.',
args: [], args: [],
); );
} }
@ -1271,6 +1271,16 @@ class S {
return Intl.message( return Intl.message(
'Recover subscribe', 'Recover subscribe',
name: 'recoverSubscribe', name: 'recoverSubscribe',
desc: 'User can recover subscribe podcast after remove it in subscribe history page.',
args: [],
);
}
/// `Update artwork`
String get refreshArtwork {
return Intl.message(
'Update artwork',
name: 'refreshArtwork',
desc: '', desc: '',
args: [], args: [],
); );
@ -1281,7 +1291,7 @@ class S {
return Intl.message( return Intl.message(
'Remove', 'Remove',
name: 'remove', name: 'remove',
desc: '', desc: 'Remove not "removed". \nRemove a podcast or a group.',
args: [], args: [],
); );
} }
@ -1554,7 +1564,7 @@ class S {
return Intl.message( return Intl.message(
'Discovery Features Again', 'Discovery Features Again',
name: 'settingsDiscovery', name: 'settingsDiscovery',
desc: '', desc: 'Reset feature discovery state. User tap it and restart app, will see features tutorial again.',
args: [], args: [],
); );
} }
@ -2054,7 +2064,7 @@ class S {
return Intl.message( return Intl.message(
'Last time $time', 'Last time $time',
name: 'timeLastPlayed', name: 'timeLastPlayed',
desc: '', desc: 'Show last time stop position in player when a episode have been played.',
args: [time], args: [time],
); );
} }
@ -2094,7 +2104,7 @@ class S {
return Intl.message( return Intl.message(
'Discovery feature reopened, pleast restart the app', 'Discovery feature reopened, pleast restart the app',
name: 'toastDiscovery', name: 'toastDiscovery',
desc: '', desc: 'Toast displayed when user tap Discovery Features Again in settings page.',
args: [], args: [],
); );
} }
@ -2204,7 +2214,7 @@ class S {
return Intl.message( return Intl.message(
'Time is equal to end time', 'Time is equal to end time',
name: 'toastTimeEqualEnd', name: 'toastTimeEqualEnd',
desc: '', desc: 'User can\'t choose the same time as schedule end time.',
args: [], args: [],
); );
} }
@ -2214,7 +2224,7 @@ class S {
return Intl.message( return Intl.message(
'Time is equal to start time', 'Time is equal to start time',
name: 'toastTimeEqualStart', name: 'toastTimeEqualStart',
desc: '', desc: 'User can\'t choose the same time as schedule start time.',
args: [], args: [],
); );
} }

View File

@ -6,7 +6,7 @@ import 'package:line_icons/line_icons.dart';
import '../util/context_extension.dart'; import '../util/context_extension.dart';
const String version = '0.4.6'; const String version = '0.4.7';
class AboutApp extends StatelessWidget { class AboutApp extends StatelessWidget {
_launchUrl(String url) async { _launchUrl(String url) async {

View File

@ -107,7 +107,9 @@
"feedbackGithub": "Submit issue", "feedbackGithub": "Submit issue",
"@feedbackGithub": {}, "@feedbackGithub": {},
"feedbackPlay": "Rate on Play", "feedbackPlay": "Rate on Play",
"@feedbackPlay": {}, "@feedbackPlay": {
"description": "Rate on Google Play Store.\nUser can tap to open play link."
},
"feedbackTelegram": "Join group", "feedbackTelegram": "Join group",
"@feedbackTelegram": {}, "@feedbackTelegram": {},
"fonts": "Fonts", "fonts": "Fonts",
@ -121,7 +123,9 @@
"goodNight": "Good Night", "goodNight": "Good Night",
"@goodNight": {}, "@goodNight": {},
"groupExisted": "Group existed", "groupExisted": "Group existed",
"@groupExisted": {}, "@groupExisted": {
"description": "Group name validate in add group dialog. User can't add group with same name."
},
"groupFilter": "Group filter", "groupFilter": "Group filter",
"@groupFilter": {}, "@groupFilter": {},
"groupRemoveConfirm": "Are you sure you want to delete this group? Podcasts will be moved to Home group.", "groupRemoveConfirm": "Are you sure you want to delete this group? Podcasts will be moved to Home group.",
@ -171,7 +175,9 @@
"liked": "Liked", "liked": "Liked",
"@liked": {}, "@liked": {},
"likeDate": "Like date", "likeDate": "Like date",
"@likeDate": {}, "@likeDate": {
"description": "Favorite tab, sort by like date."
},
"listen": "Listen", "listen": "Listen",
"@listen": {}, "@listen": {},
"listened": "Listened", "listened": "Listened",
@ -180,7 +186,7 @@
"@loadMore": {}, "@loadMore": {},
"mark": "Mark", "mark": "Mark",
"@mark": { "@mark": {
"description": "The short the best" "description": "In listen history page, if a episode is marked as listened."
}, },
"markConfirm": "Mark confirm", "markConfirm": "Mark confirm",
"@markConfirm": {}, "@markConfirm": {},
@ -291,9 +297,15 @@
} }
}, },
"recoverSubscribe": "Recover subscribe", "recoverSubscribe": "Recover subscribe",
"@recoverSubscribe": {}, "@recoverSubscribe": {
"description": "User can recover subscribe podcast after remove it in subscribe history page."
},
"refreshArtwork": "Update artwork",
"@refreshArtwork": {},
"remove": "Remove", "remove": "Remove",
"@remove": {}, "@remove": {
"description": "Remove not \"removed\". \nRemove a podcast or a group."
},
"removeConfirm": "Remove confirm", "removeConfirm": "Remove confirm",
"@removeConfirm": { "@removeConfirm": {
"description": "unsubscribe podcast dialog" "description": "unsubscribe podcast dialog"
@ -354,7 +366,9 @@
"settingsDefaultGridRecent": "Recent tab", "settingsDefaultGridRecent": "Recent tab",
"@settingsDefaultGridRecent": {}, "@settingsDefaultGridRecent": {},
"settingsDiscovery": "Discovery Features Again", "settingsDiscovery": "Discovery Features Again",
"@settingsDiscovery": {}, "@settingsDiscovery": {
"description": "Reset feature discovery state. User tap it and restart app, will see features tutorial again."
},
"settingsEnableSyncing": "Enable syncing", "settingsEnableSyncing": "Enable syncing",
"@settingsEnableSyncing": {}, "@settingsEnableSyncing": {},
"settingsEnableSyncingDes": "Refresh all podcasts in the background to get leatest episodes", "settingsEnableSyncingDes": "Refresh all podcasts in the background to get leatest episodes",
@ -455,6 +469,7 @@
"@systemDefault": {}, "@systemDefault": {},
"timeLastPlayed": "Last time {time}", "timeLastPlayed": "Last time {time}",
"@timeLastPlayed": { "@timeLastPlayed": {
"description": "Show last time stop position in player when a episode have been played.",
"placeholders": { "placeholders": {
"time": {} "time": {}
} }
@ -474,7 +489,9 @@
"toastAddPlaylist": "Added to playlist", "toastAddPlaylist": "Added to playlist",
"@toastAddPlaylist": {}, "@toastAddPlaylist": {},
"toastDiscovery": "Discovery feature reopened, pleast restart the app", "toastDiscovery": "Discovery feature reopened, pleast restart the app",
"@toastDiscovery": {}, "@toastDiscovery": {
"description": "Toast displayed when user tap Discovery Features Again in settings page."
},
"toastFileError": "File error, subscribe failed", "toastFileError": "File error, subscribe failed",
"@toastFileError": {}, "@toastFileError": {},
"toastFileNotValid": "File not valid", "toastFileNotValid": "File not valid",
@ -500,9 +517,13 @@
"toastSettingSaved": "Setting saved", "toastSettingSaved": "Setting saved",
"@toastSettingSaved": {}, "@toastSettingSaved": {},
"toastTimeEqualEnd": "Time is equal to end time", "toastTimeEqualEnd": "Time is equal to end time",
"@toastTimeEqualEnd": {}, "@toastTimeEqualEnd": {
"description": "User can't choose the same time as schedule end time."
},
"toastTimeEqualStart": "Time is equal to start time", "toastTimeEqualStart": "Time is equal to start time",
"@toastTimeEqualStart": {}, "@toastTimeEqualStart": {
"description": "User can't choose the same time as schedule start time."
},
"understood": "Understood", "understood": "Understood",
"@understood": {}, "@understood": {},
"undo": "UNDO", "undo": "UNDO",

View File

@ -107,7 +107,9 @@
"feedbackGithub": "提交Issue", "feedbackGithub": "提交Issue",
"@feedbackGithub": {}, "@feedbackGithub": {},
"feedbackPlay": "Play评价", "feedbackPlay": "Play评价",
"@feedbackPlay": {}, "@feedbackPlay": {
"description": "Rate on Google Play Store.\nUser can tap to open play link."
},
"feedbackTelegram": "加入小组", "feedbackTelegram": "加入小组",
"@feedbackTelegram": {}, "@feedbackTelegram": {},
"fonts": "字体", "fonts": "字体",
@ -121,7 +123,9 @@
"goodNight": "晚安", "goodNight": "晚安",
"@goodNight": {}, "@goodNight": {},
"groupExisted": "组名已使用", "groupExisted": "组名已使用",
"@groupExisted": {}, "@groupExisted": {
"description": "Group name validate in add group dialog. User can't add group with same name."
},
"groupFilter": "分组", "groupFilter": "分组",
"@groupFilter": {}, "@groupFilter": {},
"groupRemoveConfirm": "您确认要移除该分组吗?播客将被移动到 Home 分组。", "groupRemoveConfirm": "您确认要移除该分组吗?播客将被移动到 Home 分组。",
@ -171,7 +175,9 @@
"liked": "已收藏", "liked": "已收藏",
"@liked": {}, "@liked": {},
"likeDate": "收藏日期", "likeDate": "收藏日期",
"@likeDate": {}, "@likeDate": {
"description": "Favorite tab, sort by like date."
},
"listen": "收听", "listen": "收听",
"@listen": {}, "@listen": {},
"listened": "已收听", "listened": "已收听",
@ -180,7 +186,7 @@
"@loadMore": {}, "@loadMore": {},
"mark": "标记", "mark": "标记",
"@mark": { "@mark": {
"description": "The short the best" "description": "In listen history page, if a episode is marked as listened."
}, },
"markConfirm": "确认标记", "markConfirm": "确认标记",
"@markConfirm": {}, "@markConfirm": {},
@ -291,9 +297,15 @@
} }
}, },
"recoverSubscribe": "恢复订阅", "recoverSubscribe": "恢复订阅",
"@recoverSubscribe": {}, "@recoverSubscribe": {
"description": "User can recover subscribe podcast after remove it in subscribe history page."
},
"refreshArtwork": "更新头像",
"@refreshArtwork": {},
"remove": "移除", "remove": "移除",
"@remove": {}, "@remove": {
"description": "Remove not \"removed\". \nRemove a podcast or a group."
},
"removeConfirm": "取消订阅", "removeConfirm": "取消订阅",
"@removeConfirm": { "@removeConfirm": {
"description": "unsubscribe podcast dialog" "description": "unsubscribe podcast dialog"
@ -354,7 +366,9 @@
"settingsDefaultGridRecent": "最近页", "settingsDefaultGridRecent": "最近页",
"@settingsDefaultGridRecent": {}, "@settingsDefaultGridRecent": {},
"settingsDiscovery": "再次功能介绍", "settingsDiscovery": "再次功能介绍",
"@settingsDiscovery": {}, "@settingsDiscovery": {
"description": "Reset feature discovery state. User tap it and restart app, will see features tutorial again."
},
"settingsEnableSyncing": "开启自动更新", "settingsEnableSyncing": "开启自动更新",
"@settingsEnableSyncing": {}, "@settingsEnableSyncing": {},
"settingsEnableSyncingDes": "在后台更新所有订阅播客", "settingsEnableSyncingDes": "在后台更新所有订阅播客",
@ -455,6 +469,7 @@
"@systemDefault": {}, "@systemDefault": {},
"timeLastPlayed": "上次播放{time}", "timeLastPlayed": "上次播放{time}",
"@timeLastPlayed": { "@timeLastPlayed": {
"description": "Show last time stop position in player when a episode have been played.",
"placeholders": { "placeholders": {
"time": {} "time": {}
} }
@ -474,7 +489,9 @@
"toastAddPlaylist": "添加到播放列表", "toastAddPlaylist": "添加到播放列表",
"@toastAddPlaylist": {}, "@toastAddPlaylist": {},
"toastDiscovery": "重启应用后可查看", "toastDiscovery": "重启应用后可查看",
"@toastDiscovery": {}, "@toastDiscovery": {
"description": "Toast displayed when user tap Discovery Features Again in settings page."
},
"toastFileError": "文件错误,导入失败", "toastFileError": "文件错误,导入失败",
"@toastFileError": {}, "@toastFileError": {},
"toastFileNotValid": "文件错误", "toastFileNotValid": "文件错误",
@ -499,10 +516,14 @@
"@toastRemovePlaylist": {}, "@toastRemovePlaylist": {},
"toastSettingSaved": "设置已保存", "toastSettingSaved": "设置已保存",
"@toastSettingSaved": {}, "@toastSettingSaved": {},
"toastTimeEqualEnd": "与结束时间相同", "toastTimeEqualEnd": "与结束时刻相同",
"@toastTimeEqualEnd": {}, "@toastTimeEqualEnd": {
"toastTimeEqualStart": "与起始时间相同", "description": "User can't choose the same time as schedule end time."
"@toastTimeEqualStart": {}, },
"toastTimeEqualStart": "与起始时刻相同",
"@toastTimeEqualStart": {
"description": "User can't choose the same time as schedule start time."
},
"understood": "了解", "understood": "了解",
"@understood": {}, "@understood": {},
"undo": "撤销", "undo": "撤销",

View File

@ -150,13 +150,16 @@ class _PodcastDetailState extends State<PodcastDetail> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 10), padding: EdgeInsets.symmetric(vertical: 10),
child: Text(widget.podcastLocal.title, child: Text(
widget.podcastLocal.title,
maxLines: 2, maxLines: 2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.headline5 .headline5
.copyWith(color: Colors.white))), .copyWith(color: Colors.white),
),
),
); );
} }

View File

@ -20,8 +20,13 @@ class _StorageSettingState extends State<StorageSetting>
AnimationController _controller; AnimationController _controller;
Animation<double> _animation; Animation<double> _animation;
_getCacheMax() async { _getCacheMax() async {
int cache = await cacheStorage.getInt(); int cache =
int value = cache == 0 ? 200 : cache ~/ (1024 * 1024); await cacheStorage.getInt(defaultValue: (200 * 1024 * 1024).toInt());
if (cache == 0) {
await cacheStorage.saveInt((200 * 1024 * 1024).toInt());
cache = 200 * 1024 * 1024;
}
int value = cache ~/ (1024 * 1024);
if (value > 100) { if (value > 100) {
_controller = AnimationController( _controller = AnimationController(
vsync: this, duration: Duration(milliseconds: value * 2)); vsync: this, duration: Duration(milliseconds: value * 2));

View File

@ -671,7 +671,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
bool _lostFocus; bool _lostFocus;
bool _playing; bool _playing;
bool _stopAtEnd; bool _stopAtEnd;
int cacheMax; int _cacheMax;
bool get hasNext => _queue.length > 0; bool get hasNext => _queue.length > 0;
MediaItem get mediaItem => _queue.length > 0 ? _queue.first : null; MediaItem get mediaItem => _queue.length > 0 ? _queue.first : null;
@ -699,6 +699,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
Future<void> onStart() async { Future<void> onStart() async {
_stopAtEnd = false; _stopAtEnd = false;
_lostFocus = false; _lostFocus = false;
var playerStateSubscription = _audioPlayer.playbackStateStream var playerStateSubscription = _audioPlayer.playbackStateStream
.where((state) => state == AudioPlaybackState.completed) .where((state) => state == AudioPlaybackState.completed)
.listen((state) { .listen((state) {
@ -759,7 +760,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
} else { } else {
await AudioServiceBackground.setQueue(_queue); await AudioServiceBackground.setQueue(_queue);
await AudioServiceBackground.setMediaItem(mediaItem); await AudioServiceBackground.setMediaItem(mediaItem);
await _audioPlayer.setUrl(mediaItem.id, cacheMax); await _audioPlayer.setUrl(mediaItem.id, _cacheMax);
print(mediaItem.title); print(mediaItem.title);
Duration duration = await _audioPlayer.durationFuture; Duration duration = await _audioPlayer.durationFuture;
if (duration != null) if (duration != null)
@ -781,11 +782,14 @@ class AudioPlayerTask extends BackgroundAudioTask {
if (_skipState == null) { if (_skipState == null) {
if (_playing == null) { if (_playing == null) {
_playing = true; _playing = true;
int cacheMax = _cacheMax = await cacheStorage.getInt(
await cacheStorage.getInt(defaultValue: 200 * 1024 * 1024); defaultValue: (200 * 1024 * 1024).toInt());
// await AudioServiceBackground.setQueue(_queue); // await AudioServiceBackground.setQueue(_queue);
await _audioPlayer.setUrl(mediaItem.id, cacheMax); if (_cacheMax == 0) {
await cacheStorage.saveInt((200 * 1024 * 1024).toInt());
_cacheMax = 200 * 1024 * 1024;
}
await _audioPlayer.setUrl(mediaItem.id, _cacheMax);
var duration = await _audioPlayer.durationFuture; var duration = await _audioPlayer.durationFuture;
if (duration != null) if (duration != null)
await AudioServiceBackground.setMediaItem( await AudioServiceBackground.setMediaItem(
@ -886,7 +890,7 @@ class AudioPlayerTask extends BackgroundAudioTask {
_queue.insert(0, mediaItem); _queue.insert(0, mediaItem);
await AudioServiceBackground.setQueue(_queue); await AudioServiceBackground.setQueue(_queue);
await AudioServiceBackground.setMediaItem(mediaItem); await AudioServiceBackground.setMediaItem(mediaItem);
await _audioPlayer.setUrl(mediaItem.id, cacheMax); await _audioPlayer.setUrl(mediaItem.id, _cacheMax);
Duration duration = await _audioPlayer.durationFuture ?? Duration.zero; Duration duration = await _audioPlayer.durationFuture ?? Duration.zero;
AudioServiceBackground.setMediaItem( AudioServiceBackground.setMediaItem(
mediaItem.copyWith(duration: duration.inMilliseconds)); mediaItem.copyWith(duration: duration.inMilliseconds));

View File

@ -464,18 +464,19 @@ Future<void> subIsolateEntryPoint(SendPort sendPort) async {
await Dio().get<List<int>>(p.itunes.image.href, await Dio().get<List<int>>(p.itunes.image.href,
options: Options( options: Options(
responseType: ResponseType.bytes, responseType: ResponseType.bytes,
receiveTimeout: 60000, receiveTimeout: 90000,
)); ));
imageUrl = p.itunes.image.href; imageUrl = p.itunes.image.href;
img.Image image = img.decodeImage(imageResponse.data); img.Image image = img.decodeImage(imageResponse.data);
thumbnail = img.copyResize(image, width: 300); thumbnail = img.copyResize(image, width: 300);
} catch (e) { } catch (e) {
try { try {
Response<List<int>> imageResponse = await Dio(BaseOptions( Response<List<int>> imageResponse =
connectTimeout: 20000, await Dio().get<List<int>>(item.imgUrl,
receiveTimeout: 60000, options: Options(
)).get<List<int>>(item.imgUrl, responseType: ResponseType.bytes,
options: Options(responseType: ResponseType.bytes)); receiveTimeout: 90000,
));
imageUrl = item.imgUrl; imageUrl = item.imgUrl;
img.Image image = img.decodeImage(imageResponse.data); img.Image image = img.decodeImage(imageResponse.data);
thumbnail = img.copyResize(image, width: 300); thumbnail = img.copyResize(image, width: 300);

View File

@ -7,12 +7,13 @@ import '../local_storage/key_value_storage.dart';
import '../local_storage/sqflite_localpodcast.dart'; import '../local_storage/sqflite_localpodcast.dart';
import '../type/podcastlocal.dart'; import '../type/podcastlocal.dart';
enum RefreshState { none, fetch, error } enum RefreshState { none, fetch, error, artwork }
class RefreshItem { class RefreshItem {
String title; String title;
RefreshState refreshState; RefreshState refreshState;
RefreshItem(this.title, this.refreshState); bool artwork;
RefreshItem(this.title, this.refreshState, {this.artwork = false});
} }
class RefreshWorker extends ChangeNotifier { class RefreshWorker extends ChangeNotifier {

View File

@ -1,7 +1,7 @@
name: tsacdop name: tsacdop
description: An easy-use podacasts player. description: An easy-use podacasts player.
version: 0.4.6+22 version: 0.4.7+23
environment: environment:
sdk: ">=2.6.0 <3.0.0" sdk: ">=2.6.0 <3.0.0"