0.6.11 - noone cares or reads this anyway, the repo is for issues, and the code so bad, it's practically obfuscated
This commit is contained in:
parent
9f850a6f30
commit
aa7f82b399
11 changed files with 111 additions and 31 deletions
|
@ -634,14 +634,19 @@ class HomePageSection {
|
|||
);
|
||||
|
||||
String layout = json['layout'];
|
||||
//No ads there
|
||||
if (layout == 'ads') return null;
|
||||
if (layout == 'horizontal-grid' || layout == 'grid') {
|
||||
hps.layout = HomePageSectionLayout.ROW;
|
||||
} else {
|
||||
//Currently only row layout
|
||||
return null;
|
||||
switch (layout) {
|
||||
case 'ads':
|
||||
return null;
|
||||
case 'horizontal-grid':
|
||||
hps.layout = HomePageSectionLayout.ROW;
|
||||
break;
|
||||
case 'grid':
|
||||
hps.layout = HomePageSectionLayout.GRID;
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
//Parse items
|
||||
for (var i in (json['items']??[])) {
|
||||
HomePageItem hpi = HomePageItem.fromPrivateJson(i);
|
||||
|
@ -747,7 +752,8 @@ enum HomePageItemType {
|
|||
}
|
||||
|
||||
enum HomePageSectionLayout {
|
||||
ROW
|
||||
ROW,
|
||||
GRID
|
||||
}
|
||||
|
||||
enum RepeatType {
|
||||
|
|
|
@ -368,6 +368,7 @@ Map<String, dynamic> _$HomePageSectionToJson(HomePageSection instance) =>
|
|||
|
||||
const _$HomePageSectionLayoutEnumMap = {
|
||||
HomePageSectionLayout.ROW: 'ROW',
|
||||
HomePageSectionLayout.GRID: 'GRID',
|
||||
};
|
||||
|
||||
DeezerChannel _$DeezerChannelFromJson(Map<String, dynamic> json) {
|
||||
|
|
|
@ -392,21 +392,24 @@ class DownloadManager {
|
|||
for (Track t in tracks) {
|
||||
//Check if library
|
||||
List rawTrack = await db.query('Tracks', where: 'id == ?', whereArgs: [t.id], columns: ['favorite']);
|
||||
if (rawTrack.length > 0 && rawTrack[0]['favorite'] == 0) {
|
||||
if (rawTrack.length > 0) {
|
||||
//Count occurrences in playlists and albums
|
||||
List albums = await db.rawQuery('SELECT (id) FROM Albums WHERE tracks LIKE "%${t.id}%"');
|
||||
List playlists = await db.rawQuery('SELECT (id) FROM Playlists WHERE tracks LIKE "%${t.id}%"');
|
||||
if (albums.length + playlists.length == 0) {
|
||||
if (albums.length + playlists.length == 0 && rawTrack[0]['favorite'] == 0) {
|
||||
//Safe to remove
|
||||
await db.delete('Tracks', where: 'id == ?', whereArgs: [t.id]);
|
||||
//Remove file
|
||||
try {
|
||||
File(p.join(offlinePath, t.id)).delete();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
} else {
|
||||
await db.update('Tracks', {'offline': 0}, where: 'id == ?', whereArgs: [t.id]);
|
||||
}
|
||||
}
|
||||
|
||||
//Remove file
|
||||
try {
|
||||
File(p.join(offlinePath, t.id)).delete();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -619,6 +619,8 @@ class AudioPlayerTask extends BackgroundAudioTask {
|
|||
@override
|
||||
Future onUpdateQueue(List<MediaItem> q) async {
|
||||
//just_audio
|
||||
_shuffle = false;
|
||||
_originalQueue = null;
|
||||
_player.stop();
|
||||
if (_audioSource != null) _audioSource.clear();
|
||||
//Filter duplicate IDs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue