Minor change.

This commit is contained in:
stonega 2021-02-17 23:25:23 +08:00
parent 927907b78f
commit 97406a1ddb
3 changed files with 25 additions and 14 deletions

View File

@ -5,12 +5,12 @@ import 'package:flutter/services.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'package:tsacdop/playlists/playlist_home.dart';
import 'package:tuple/tuple.dart';
import 'generated/l10n.dart';
import 'home/home.dart';
import 'intro_slider/app_intro.dart';
import 'playlists/playlist_home.dart';
import 'state/audio_state.dart';
import 'state/download_state.dart';
import 'state/podcast_group.dart';

View File

@ -282,7 +282,8 @@ class AudioPlayerNotifier extends ChangeNotifier {
await _playlist.getPlaylist();
if (state[1] != '') {
var episode = await _dbHelper.getRssItemWithUrl(state[1]);
if (episode != null && ((!_playlist.isQueue &&
if (episode != null &&
((!_playlist.isQueue &&
episode != null &&
_playlist.contains(episode)) ||
(_playlist.isQueue &&
@ -745,6 +746,9 @@ class AudioPlayerNotifier extends ChangeNotifier {
}
notifyListeners();
_savePlaylists();
if (playlist.isLocal) {
_dbHelper.deleteLocalEpisodes(playlist.episodeList);
}
}
void addEpisodesToPlaylist(Playlist playlist, {List<EpisodeBrief> episodes}) {
@ -1114,9 +1118,13 @@ class AudioPlayerTask extends BackgroundAudioTask {
_queue.removeAt(0);
}
await AudioServiceBackground.setQueue(_queue);
} else {
if (_index == _queue.length - 1) {
_index = 0;
} else {
_index += 1;
}
}
if (_queue.length == 0 || _stopAtEnd) {
_skipState = null;

View File

@ -129,12 +129,14 @@ class EpisodeCard extends StatelessWidget {
final bool isPlaying;
final bool canReorder;
final bool showDivider;
final bool havePadding;
const EpisodeCard(this.episode,
{this.tileColor,
this.onTap,
this.isPlaying,
this.canReorder = false,
this.showDivider = true,
this.havePadding = false,
Key key})
: assert(episode != null),
super(key: key);
@ -165,8 +167,9 @@ class EpisodeCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
if (canReorder) Icon(Icons.unfold_more, color: c),
SizedBox(width: canReorder ? 0 : 24),
if (canReorder && !havePadding)
Icon(Icons.unfold_more, color: c),
SizedBox(width: canReorder && !havePadding ? 0 : 24),
CircleAvatar(
backgroundColor: c.withOpacity(0.5),
backgroundImage: episode.avatarImage),