♻️ Moved player state from shared_prefs to drift
🍱 Update icons
This commit is contained in:
@ -5,6 +5,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:drift/drift.dart';
|
||||
import 'package:encrypt/encrypt.dart';
|
||||
import 'package:media_kit/media_kit.dart' hide Track;
|
||||
import 'package:path/path.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:rhythm_box/services/color.dart';
|
||||
@ -27,6 +28,7 @@ part 'tables/skip_segment.dart';
|
||||
part 'tables/source_match.dart';
|
||||
part 'tables/history.dart';
|
||||
part 'tables/lyrics.dart';
|
||||
part 'tables/audio_player_state.dart';
|
||||
|
||||
part 'typeconverters/color.dart';
|
||||
part 'typeconverters/locale.dart';
|
||||
@ -44,6 +46,9 @@ part 'typeconverters/subtitle.dart';
|
||||
SourceMatchTable,
|
||||
HistoryTable,
|
||||
LyricsTable,
|
||||
AudioPlayerStateTable,
|
||||
PlaylistTable,
|
||||
PlaylistMediaTable,
|
||||
],
|
||||
)
|
||||
class AppDatabase extends _$AppDatabase {
|
||||
|
File diff suppressed because it is too large
Load Diff
27
lib/services/database/tables/audio_player_state.dart
Executable file
27
lib/services/database/tables/audio_player_state.dart
Executable file
@ -0,0 +1,27 @@
|
||||
part of '../database.dart';
|
||||
|
||||
class AudioPlayerStateTable extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
BoolColumn get playing => boolean()();
|
||||
TextColumn get loopMode => textEnum<PlaylistMode>()();
|
||||
BoolColumn get shuffled => boolean()();
|
||||
TextColumn get collections => text().map(const StringListConverter())();
|
||||
}
|
||||
|
||||
class PlaylistTable extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
IntColumn get audioPlayerStateId =>
|
||||
integer().references(AudioPlayerStateTable, #id)();
|
||||
IntColumn get index => integer()();
|
||||
}
|
||||
|
||||
class PlaylistMediaTable extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
IntColumn get playlistId => integer().references(PlaylistTable, #id)();
|
||||
|
||||
TextColumn get uri => text()();
|
||||
TextColumn get extras =>
|
||||
text().nullable().map(const MapTypeConverter<String, dynamic>())();
|
||||
TextColumn get httpHeaders =>
|
||||
text().nullable().map(const MapTypeConverter<String, String>())();
|
||||
}
|
Reference in New Issue
Block a user