Bisher landete Musik nur zufaellig auf dem Geraet: was man abspielte, blieb nebenbei liegen. Gezielt "dieses Album fuer die Zugfahrt" gab es nicht. Und dieser Zwischenspeicher wuchs unbegrenzt — es gab nur "alles loeschen". Zwei getrennte Ablagen. Bewusste Downloads liegen NICHT im Cache-Ordner: den darf Android bei Speichernot jederzeit selbst leeren, und genau das darf einem mitgenommenen Album nicht passieren. Sie liegen deshalb neben der Datenbank im Support-Ordner. Die Grenze gilt nur fuer den Zufalls-Cache; Downloads sind unbegrenzt und werden nie verdraengt. - Download-Pfeil je Album und Kuenstler, mit Fortschritt und Abbruch - Rueckfrage ab 30 Titeln samt Groessenschaetzung - Obergrenze wahlbar (aus / 512 MB / 1 / 2 / 4 / 8 GB), Standard 2 GB; am laengsten nicht Gehoertes weicht zuerst - Liste "Heruntergeladen" mit Titel, Kuenstler, Groesse, einzeln oder alle entfernbar (Schema 10) - Wiedergabe nimmt erst den Download, dann den Zwischenspeicher Aus dem Code-Review nachgebessert, vier ernste Punkte: "aus" (0 MB) schaltete das Aufraeumen ab statt das Zwischenspeichern und liess den Cache unbegrenzt wachsen; wer sich erst waehrend der Sitzung am Server anmeldete, konnte gar nichts laden; die Verdraengung konnte Dateien loeschen, die die laufende Warteschlange schon als Quelle eingetragen hatte (Abbruch mitten im Album, ohne Rueckfall aufs Streamen); und ein heruntergeladener Titel wurde beim Abspielen ein zweites Mal in den Cache geholt. Dazu sechs kleinere und der "zuletzt gehoert"-Stempel, der beim Aufbau der Warteschlange statt beim Abspielen gesetzt wurde. Nebenbei aufgeraeumt, weil die Dateien ohnehin offen waren: keine Emoji als Knoepfe mehr, kein Colors.redAccent und kein grey.shade mehr im ganzen Projekt, und die Einstellungen heissen nicht mehr "Settings". 433 Tests gruen (vorher 411), flutter analyze ohne Befund, Release-APK gebaut. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013xAHJTJM6UUqmjUgk1PUEd
6003 lines
188 KiB
Dart
6003 lines
188 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'database.dart';
|
|
|
|
// ignore_for_file: type=lint
|
|
class $SongsTable extends Songs with TableInfo<$SongsTable, Song> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$SongsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _pathMeta = const VerificationMeta('path');
|
|
@override
|
|
late final GeneratedColumn<String> path = GeneratedColumn<String>(
|
|
'path',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
|
|
);
|
|
static const VerificationMeta _titleMeta = const VerificationMeta('title');
|
|
@override
|
|
late final GeneratedColumn<String> title = GeneratedColumn<String>(
|
|
'title',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _artistMeta = const VerificationMeta('artist');
|
|
@override
|
|
late final GeneratedColumn<String> artist = GeneratedColumn<String>(
|
|
'artist',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _albumMeta = const VerificationMeta('album');
|
|
@override
|
|
late final GeneratedColumn<String> album = GeneratedColumn<String>(
|
|
'album',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _durationMsMeta = const VerificationMeta(
|
|
'durationMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> durationMs = GeneratedColumn<int>(
|
|
'duration_ms',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _coverPathMeta = const VerificationMeta(
|
|
'coverPath',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> coverPath = GeneratedColumn<String>(
|
|
'cover_path',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _dateAddedMsMeta = const VerificationMeta(
|
|
'dateAddedMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> dateAddedMs = GeneratedColumn<int>(
|
|
'date_added_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMsMeta = const VerificationMeta(
|
|
'updatedAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> updatedAtMs = GeneratedColumn<int>(
|
|
'updated_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedMeta = const VerificationMeta(
|
|
'deleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> deleted = GeneratedColumn<bool>(
|
|
'deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _playCountMeta = const VerificationMeta(
|
|
'playCount',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> playCount = GeneratedColumn<int>(
|
|
'play_count',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: false,
|
|
defaultValue: const Constant(0),
|
|
);
|
|
static const VerificationMeta _categoriesEditedMeta = const VerificationMeta(
|
|
'categoriesEdited',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> categoriesEdited = GeneratedColumn<bool>(
|
|
'categories_edited',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("categories_edited" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _metadataEditedMeta = const VerificationMeta(
|
|
'metadataEdited',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> metadataEdited = GeneratedColumn<bool>(
|
|
'metadata_edited',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("metadata_edited" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
static const VerificationMeta _lyricsMeta = const VerificationMeta('lyrics');
|
|
@override
|
|
late final GeneratedColumn<String> lyrics = GeneratedColumn<String>(
|
|
'lyrics',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _gainDbMeta = const VerificationMeta('gainDb');
|
|
@override
|
|
late final GeneratedColumn<double> gainDb = GeneratedColumn<double>(
|
|
'gain_db',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.double,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _cloudIdMeta = const VerificationMeta(
|
|
'cloudId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> cloudId = GeneratedColumn<String>(
|
|
'cloud_id',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
path,
|
|
title,
|
|
artist,
|
|
album,
|
|
durationMs,
|
|
coverPath,
|
|
dateAddedMs,
|
|
updatedAtMs,
|
|
deleted,
|
|
playCount,
|
|
categoriesEdited,
|
|
metadataEdited,
|
|
lyrics,
|
|
gainDb,
|
|
cloudId,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'songs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Song> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('path')) {
|
|
context.handle(
|
|
_pathMeta,
|
|
path.isAcceptableOrUnknown(data['path']!, _pathMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_pathMeta);
|
|
}
|
|
if (data.containsKey('title')) {
|
|
context.handle(
|
|
_titleMeta,
|
|
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titleMeta);
|
|
}
|
|
if (data.containsKey('artist')) {
|
|
context.handle(
|
|
_artistMeta,
|
|
artist.isAcceptableOrUnknown(data['artist']!, _artistMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('album')) {
|
|
context.handle(
|
|
_albumMeta,
|
|
album.isAcceptableOrUnknown(data['album']!, _albumMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('duration_ms')) {
|
|
context.handle(
|
|
_durationMsMeta,
|
|
durationMs.isAcceptableOrUnknown(data['duration_ms']!, _durationMsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('cover_path')) {
|
|
context.handle(
|
|
_coverPathMeta,
|
|
coverPath.isAcceptableOrUnknown(data['cover_path']!, _coverPathMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('date_added_ms')) {
|
|
context.handle(
|
|
_dateAddedMsMeta,
|
|
dateAddedMs.isAcceptableOrUnknown(
|
|
data['date_added_ms']!,
|
|
_dateAddedMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_dateAddedMsMeta);
|
|
}
|
|
if (data.containsKey('updated_at_ms')) {
|
|
context.handle(
|
|
_updatedAtMsMeta,
|
|
updatedAtMs.isAcceptableOrUnknown(
|
|
data['updated_at_ms']!,
|
|
_updatedAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMsMeta);
|
|
}
|
|
if (data.containsKey('deleted')) {
|
|
context.handle(
|
|
_deletedMeta,
|
|
deleted.isAcceptableOrUnknown(data['deleted']!, _deletedMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('play_count')) {
|
|
context.handle(
|
|
_playCountMeta,
|
|
playCount.isAcceptableOrUnknown(data['play_count']!, _playCountMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('categories_edited')) {
|
|
context.handle(
|
|
_categoriesEditedMeta,
|
|
categoriesEdited.isAcceptableOrUnknown(
|
|
data['categories_edited']!,
|
|
_categoriesEditedMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('metadata_edited')) {
|
|
context.handle(
|
|
_metadataEditedMeta,
|
|
metadataEdited.isAcceptableOrUnknown(
|
|
data['metadata_edited']!,
|
|
_metadataEditedMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('lyrics')) {
|
|
context.handle(
|
|
_lyricsMeta,
|
|
lyrics.isAcceptableOrUnknown(data['lyrics']!, _lyricsMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('gain_db')) {
|
|
context.handle(
|
|
_gainDbMeta,
|
|
gainDb.isAcceptableOrUnknown(data['gain_db']!, _gainDbMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('cloud_id')) {
|
|
context.handle(
|
|
_cloudIdMeta,
|
|
cloudId.isAcceptableOrUnknown(data['cloud_id']!, _cloudIdMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Song map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Song(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
path: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}path'],
|
|
)!,
|
|
title: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}title'],
|
|
)!,
|
|
artist: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}artist'],
|
|
),
|
|
album: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}album'],
|
|
),
|
|
durationMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}duration_ms'],
|
|
),
|
|
coverPath: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}cover_path'],
|
|
),
|
|
dateAddedMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}date_added_ms'],
|
|
)!,
|
|
updatedAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}updated_at_ms'],
|
|
)!,
|
|
deleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}deleted'],
|
|
)!,
|
|
playCount: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}play_count'],
|
|
)!,
|
|
categoriesEdited: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}categories_edited'],
|
|
)!,
|
|
metadataEdited: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}metadata_edited'],
|
|
)!,
|
|
lyrics: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}lyrics'],
|
|
),
|
|
gainDb: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.double,
|
|
data['${effectivePrefix}gain_db'],
|
|
),
|
|
cloudId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}cloud_id'],
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
$SongsTable createAlias(String alias) {
|
|
return $SongsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Song extends DataClass implements Insertable<Song> {
|
|
final String id;
|
|
final String path;
|
|
final String title;
|
|
final String? artist;
|
|
final String? album;
|
|
final int? durationMs;
|
|
final String? coverPath;
|
|
final int dateAddedMs;
|
|
final int updatedAtMs;
|
|
final bool deleted;
|
|
|
|
/// Wie oft der Song vollständig gestartet wurde — Grundlage für die
|
|
/// Sortierung "Wie oft abgespielt".
|
|
final int playCount;
|
|
|
|
/// Sobald die Kategorien eines Songs von Hand geändert wurden, überschreibt
|
|
/// ein erneuter Scan sie nicht mehr mit dem Genre-Tag der Datei.
|
|
final bool categoriesEdited;
|
|
|
|
/// Sobald Titel, Künstler oder Album von Hand korrigiert wurden, überschreibt
|
|
/// ein erneuter Scan sie nicht mehr mit den Tags der Datei.
|
|
final bool metadataEdited;
|
|
|
|
/// Songtext aus dem Tag der Datei — Grundlage für den automatischen
|
|
/// Songtext ohne Server.
|
|
final String? lyrics;
|
|
|
|
/// ReplayGain des Titels in Dezibel, sofern die Datei den Tag mitbringt —
|
|
/// Grundlage für "Gleiche Lautstärke".
|
|
final double? gainDb;
|
|
|
|
/// ID desselben Titels in der Melo-Cloud. Verbindet den Titel auf dem Gerät
|
|
/// mit dem am Server und ist die Grundlage des Abgleichs: ohne sie gilt ein
|
|
/// Titel als nur lokal vorhanden und wird beim nächsten Sync hochgeladen.
|
|
final String? cloudId;
|
|
const Song({
|
|
required this.id,
|
|
required this.path,
|
|
required this.title,
|
|
this.artist,
|
|
this.album,
|
|
this.durationMs,
|
|
this.coverPath,
|
|
required this.dateAddedMs,
|
|
required this.updatedAtMs,
|
|
required this.deleted,
|
|
required this.playCount,
|
|
required this.categoriesEdited,
|
|
required this.metadataEdited,
|
|
this.lyrics,
|
|
this.gainDb,
|
|
this.cloudId,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['path'] = Variable<String>(path);
|
|
map['title'] = Variable<String>(title);
|
|
if (!nullToAbsent || artist != null) {
|
|
map['artist'] = Variable<String>(artist);
|
|
}
|
|
if (!nullToAbsent || album != null) {
|
|
map['album'] = Variable<String>(album);
|
|
}
|
|
if (!nullToAbsent || durationMs != null) {
|
|
map['duration_ms'] = Variable<int>(durationMs);
|
|
}
|
|
if (!nullToAbsent || coverPath != null) {
|
|
map['cover_path'] = Variable<String>(coverPath);
|
|
}
|
|
map['date_added_ms'] = Variable<int>(dateAddedMs);
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs);
|
|
map['deleted'] = Variable<bool>(deleted);
|
|
map['play_count'] = Variable<int>(playCount);
|
|
map['categories_edited'] = Variable<bool>(categoriesEdited);
|
|
map['metadata_edited'] = Variable<bool>(metadataEdited);
|
|
if (!nullToAbsent || lyrics != null) {
|
|
map['lyrics'] = Variable<String>(lyrics);
|
|
}
|
|
if (!nullToAbsent || gainDb != null) {
|
|
map['gain_db'] = Variable<double>(gainDb);
|
|
}
|
|
if (!nullToAbsent || cloudId != null) {
|
|
map['cloud_id'] = Variable<String>(cloudId);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
SongsCompanion toCompanion(bool nullToAbsent) {
|
|
return SongsCompanion(
|
|
id: Value(id),
|
|
path: Value(path),
|
|
title: Value(title),
|
|
artist: artist == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(artist),
|
|
album: album == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(album),
|
|
durationMs: durationMs == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(durationMs),
|
|
coverPath: coverPath == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(coverPath),
|
|
dateAddedMs: Value(dateAddedMs),
|
|
updatedAtMs: Value(updatedAtMs),
|
|
deleted: Value(deleted),
|
|
playCount: Value(playCount),
|
|
categoriesEdited: Value(categoriesEdited),
|
|
metadataEdited: Value(metadataEdited),
|
|
lyrics: lyrics == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(lyrics),
|
|
gainDb: gainDb == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(gainDb),
|
|
cloudId: cloudId == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(cloudId),
|
|
);
|
|
}
|
|
|
|
factory Song.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Song(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
path: serializer.fromJson<String>(json['path']),
|
|
title: serializer.fromJson<String>(json['title']),
|
|
artist: serializer.fromJson<String?>(json['artist']),
|
|
album: serializer.fromJson<String?>(json['album']),
|
|
durationMs: serializer.fromJson<int?>(json['durationMs']),
|
|
coverPath: serializer.fromJson<String?>(json['coverPath']),
|
|
dateAddedMs: serializer.fromJson<int>(json['dateAddedMs']),
|
|
updatedAtMs: serializer.fromJson<int>(json['updatedAtMs']),
|
|
deleted: serializer.fromJson<bool>(json['deleted']),
|
|
playCount: serializer.fromJson<int>(json['playCount']),
|
|
categoriesEdited: serializer.fromJson<bool>(json['categoriesEdited']),
|
|
metadataEdited: serializer.fromJson<bool>(json['metadataEdited']),
|
|
lyrics: serializer.fromJson<String?>(json['lyrics']),
|
|
gainDb: serializer.fromJson<double?>(json['gainDb']),
|
|
cloudId: serializer.fromJson<String?>(json['cloudId']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'path': serializer.toJson<String>(path),
|
|
'title': serializer.toJson<String>(title),
|
|
'artist': serializer.toJson<String?>(artist),
|
|
'album': serializer.toJson<String?>(album),
|
|
'durationMs': serializer.toJson<int?>(durationMs),
|
|
'coverPath': serializer.toJson<String?>(coverPath),
|
|
'dateAddedMs': serializer.toJson<int>(dateAddedMs),
|
|
'updatedAtMs': serializer.toJson<int>(updatedAtMs),
|
|
'deleted': serializer.toJson<bool>(deleted),
|
|
'playCount': serializer.toJson<int>(playCount),
|
|
'categoriesEdited': serializer.toJson<bool>(categoriesEdited),
|
|
'metadataEdited': serializer.toJson<bool>(metadataEdited),
|
|
'lyrics': serializer.toJson<String?>(lyrics),
|
|
'gainDb': serializer.toJson<double?>(gainDb),
|
|
'cloudId': serializer.toJson<String?>(cloudId),
|
|
};
|
|
}
|
|
|
|
Song copyWith({
|
|
String? id,
|
|
String? path,
|
|
String? title,
|
|
Value<String?> artist = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> coverPath = const Value.absent(),
|
|
int? dateAddedMs,
|
|
int? updatedAtMs,
|
|
bool? deleted,
|
|
int? playCount,
|
|
bool? categoriesEdited,
|
|
bool? metadataEdited,
|
|
Value<String?> lyrics = const Value.absent(),
|
|
Value<double?> gainDb = const Value.absent(),
|
|
Value<String?> cloudId = const Value.absent(),
|
|
}) => Song(
|
|
id: id ?? this.id,
|
|
path: path ?? this.path,
|
|
title: title ?? this.title,
|
|
artist: artist.present ? artist.value : this.artist,
|
|
album: album.present ? album.value : this.album,
|
|
durationMs: durationMs.present ? durationMs.value : this.durationMs,
|
|
coverPath: coverPath.present ? coverPath.value : this.coverPath,
|
|
dateAddedMs: dateAddedMs ?? this.dateAddedMs,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
playCount: playCount ?? this.playCount,
|
|
categoriesEdited: categoriesEdited ?? this.categoriesEdited,
|
|
metadataEdited: metadataEdited ?? this.metadataEdited,
|
|
lyrics: lyrics.present ? lyrics.value : this.lyrics,
|
|
gainDb: gainDb.present ? gainDb.value : this.gainDb,
|
|
cloudId: cloudId.present ? cloudId.value : this.cloudId,
|
|
);
|
|
Song copyWithCompanion(SongsCompanion data) {
|
|
return Song(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
path: data.path.present ? data.path.value : this.path,
|
|
title: data.title.present ? data.title.value : this.title,
|
|
artist: data.artist.present ? data.artist.value : this.artist,
|
|
album: data.album.present ? data.album.value : this.album,
|
|
durationMs: data.durationMs.present
|
|
? data.durationMs.value
|
|
: this.durationMs,
|
|
coverPath: data.coverPath.present ? data.coverPath.value : this.coverPath,
|
|
dateAddedMs: data.dateAddedMs.present
|
|
? data.dateAddedMs.value
|
|
: this.dateAddedMs,
|
|
updatedAtMs: data.updatedAtMs.present
|
|
? data.updatedAtMs.value
|
|
: this.updatedAtMs,
|
|
deleted: data.deleted.present ? data.deleted.value : this.deleted,
|
|
playCount: data.playCount.present ? data.playCount.value : this.playCount,
|
|
categoriesEdited: data.categoriesEdited.present
|
|
? data.categoriesEdited.value
|
|
: this.categoriesEdited,
|
|
metadataEdited: data.metadataEdited.present
|
|
? data.metadataEdited.value
|
|
: this.metadataEdited,
|
|
lyrics: data.lyrics.present ? data.lyrics.value : this.lyrics,
|
|
gainDb: data.gainDb.present ? data.gainDb.value : this.gainDb,
|
|
cloudId: data.cloudId.present ? data.cloudId.value : this.cloudId,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Song(')
|
|
..write('id: $id, ')
|
|
..write('path: $path, ')
|
|
..write('title: $title, ')
|
|
..write('artist: $artist, ')
|
|
..write('album: $album, ')
|
|
..write('durationMs: $durationMs, ')
|
|
..write('coverPath: $coverPath, ')
|
|
..write('dateAddedMs: $dateAddedMs, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted, ')
|
|
..write('playCount: $playCount, ')
|
|
..write('categoriesEdited: $categoriesEdited, ')
|
|
..write('metadataEdited: $metadataEdited, ')
|
|
..write('lyrics: $lyrics, ')
|
|
..write('gainDb: $gainDb, ')
|
|
..write('cloudId: $cloudId')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
id,
|
|
path,
|
|
title,
|
|
artist,
|
|
album,
|
|
durationMs,
|
|
coverPath,
|
|
dateAddedMs,
|
|
updatedAtMs,
|
|
deleted,
|
|
playCount,
|
|
categoriesEdited,
|
|
metadataEdited,
|
|
lyrics,
|
|
gainDb,
|
|
cloudId,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Song &&
|
|
other.id == this.id &&
|
|
other.path == this.path &&
|
|
other.title == this.title &&
|
|
other.artist == this.artist &&
|
|
other.album == this.album &&
|
|
other.durationMs == this.durationMs &&
|
|
other.coverPath == this.coverPath &&
|
|
other.dateAddedMs == this.dateAddedMs &&
|
|
other.updatedAtMs == this.updatedAtMs &&
|
|
other.deleted == this.deleted &&
|
|
other.playCount == this.playCount &&
|
|
other.categoriesEdited == this.categoriesEdited &&
|
|
other.metadataEdited == this.metadataEdited &&
|
|
other.lyrics == this.lyrics &&
|
|
other.gainDb == this.gainDb &&
|
|
other.cloudId == this.cloudId);
|
|
}
|
|
|
|
class SongsCompanion extends UpdateCompanion<Song> {
|
|
final Value<String> id;
|
|
final Value<String> path;
|
|
final Value<String> title;
|
|
final Value<String?> artist;
|
|
final Value<String?> album;
|
|
final Value<int?> durationMs;
|
|
final Value<String?> coverPath;
|
|
final Value<int> dateAddedMs;
|
|
final Value<int> updatedAtMs;
|
|
final Value<bool> deleted;
|
|
final Value<int> playCount;
|
|
final Value<bool> categoriesEdited;
|
|
final Value<bool> metadataEdited;
|
|
final Value<String?> lyrics;
|
|
final Value<double?> gainDb;
|
|
final Value<String?> cloudId;
|
|
final Value<int> rowid;
|
|
const SongsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.path = const Value.absent(),
|
|
this.title = const Value.absent(),
|
|
this.artist = const Value.absent(),
|
|
this.album = const Value.absent(),
|
|
this.durationMs = const Value.absent(),
|
|
this.coverPath = const Value.absent(),
|
|
this.dateAddedMs = const Value.absent(),
|
|
this.updatedAtMs = const Value.absent(),
|
|
this.deleted = const Value.absent(),
|
|
this.playCount = const Value.absent(),
|
|
this.categoriesEdited = const Value.absent(),
|
|
this.metadataEdited = const Value.absent(),
|
|
this.lyrics = const Value.absent(),
|
|
this.gainDb = const Value.absent(),
|
|
this.cloudId = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
SongsCompanion.insert({
|
|
required String id,
|
|
required String path,
|
|
required String title,
|
|
this.artist = const Value.absent(),
|
|
this.album = const Value.absent(),
|
|
this.durationMs = const Value.absent(),
|
|
this.coverPath = const Value.absent(),
|
|
required int dateAddedMs,
|
|
required int updatedAtMs,
|
|
this.deleted = const Value.absent(),
|
|
this.playCount = const Value.absent(),
|
|
this.categoriesEdited = const Value.absent(),
|
|
this.metadataEdited = const Value.absent(),
|
|
this.lyrics = const Value.absent(),
|
|
this.gainDb = const Value.absent(),
|
|
this.cloudId = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
path = Value(path),
|
|
title = Value(title),
|
|
dateAddedMs = Value(dateAddedMs),
|
|
updatedAtMs = Value(updatedAtMs);
|
|
static Insertable<Song> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? path,
|
|
Expression<String>? title,
|
|
Expression<String>? artist,
|
|
Expression<String>? album,
|
|
Expression<int>? durationMs,
|
|
Expression<String>? coverPath,
|
|
Expression<int>? dateAddedMs,
|
|
Expression<int>? updatedAtMs,
|
|
Expression<bool>? deleted,
|
|
Expression<int>? playCount,
|
|
Expression<bool>? categoriesEdited,
|
|
Expression<bool>? metadataEdited,
|
|
Expression<String>? lyrics,
|
|
Expression<double>? gainDb,
|
|
Expression<String>? cloudId,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (path != null) 'path': path,
|
|
if (title != null) 'title': title,
|
|
if (artist != null) 'artist': artist,
|
|
if (album != null) 'album': album,
|
|
if (durationMs != null) 'duration_ms': durationMs,
|
|
if (coverPath != null) 'cover_path': coverPath,
|
|
if (dateAddedMs != null) 'date_added_ms': dateAddedMs,
|
|
if (updatedAtMs != null) 'updated_at_ms': updatedAtMs,
|
|
if (deleted != null) 'deleted': deleted,
|
|
if (playCount != null) 'play_count': playCount,
|
|
if (categoriesEdited != null) 'categories_edited': categoriesEdited,
|
|
if (metadataEdited != null) 'metadata_edited': metadataEdited,
|
|
if (lyrics != null) 'lyrics': lyrics,
|
|
if (gainDb != null) 'gain_db': gainDb,
|
|
if (cloudId != null) 'cloud_id': cloudId,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
SongsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? path,
|
|
Value<String>? title,
|
|
Value<String?>? artist,
|
|
Value<String?>? album,
|
|
Value<int?>? durationMs,
|
|
Value<String?>? coverPath,
|
|
Value<int>? dateAddedMs,
|
|
Value<int>? updatedAtMs,
|
|
Value<bool>? deleted,
|
|
Value<int>? playCount,
|
|
Value<bool>? categoriesEdited,
|
|
Value<bool>? metadataEdited,
|
|
Value<String?>? lyrics,
|
|
Value<double?>? gainDb,
|
|
Value<String?>? cloudId,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return SongsCompanion(
|
|
id: id ?? this.id,
|
|
path: path ?? this.path,
|
|
title: title ?? this.title,
|
|
artist: artist ?? this.artist,
|
|
album: album ?? this.album,
|
|
durationMs: durationMs ?? this.durationMs,
|
|
coverPath: coverPath ?? this.coverPath,
|
|
dateAddedMs: dateAddedMs ?? this.dateAddedMs,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
playCount: playCount ?? this.playCount,
|
|
categoriesEdited: categoriesEdited ?? this.categoriesEdited,
|
|
metadataEdited: metadataEdited ?? this.metadataEdited,
|
|
lyrics: lyrics ?? this.lyrics,
|
|
gainDb: gainDb ?? this.gainDb,
|
|
cloudId: cloudId ?? this.cloudId,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (path.present) {
|
|
map['path'] = Variable<String>(path.value);
|
|
}
|
|
if (title.present) {
|
|
map['title'] = Variable<String>(title.value);
|
|
}
|
|
if (artist.present) {
|
|
map['artist'] = Variable<String>(artist.value);
|
|
}
|
|
if (album.present) {
|
|
map['album'] = Variable<String>(album.value);
|
|
}
|
|
if (durationMs.present) {
|
|
map['duration_ms'] = Variable<int>(durationMs.value);
|
|
}
|
|
if (coverPath.present) {
|
|
map['cover_path'] = Variable<String>(coverPath.value);
|
|
}
|
|
if (dateAddedMs.present) {
|
|
map['date_added_ms'] = Variable<int>(dateAddedMs.value);
|
|
}
|
|
if (updatedAtMs.present) {
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs.value);
|
|
}
|
|
if (deleted.present) {
|
|
map['deleted'] = Variable<bool>(deleted.value);
|
|
}
|
|
if (playCount.present) {
|
|
map['play_count'] = Variable<int>(playCount.value);
|
|
}
|
|
if (categoriesEdited.present) {
|
|
map['categories_edited'] = Variable<bool>(categoriesEdited.value);
|
|
}
|
|
if (metadataEdited.present) {
|
|
map['metadata_edited'] = Variable<bool>(metadataEdited.value);
|
|
}
|
|
if (lyrics.present) {
|
|
map['lyrics'] = Variable<String>(lyrics.value);
|
|
}
|
|
if (gainDb.present) {
|
|
map['gain_db'] = Variable<double>(gainDb.value);
|
|
}
|
|
if (cloudId.present) {
|
|
map['cloud_id'] = Variable<String>(cloudId.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SongsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('path: $path, ')
|
|
..write('title: $title, ')
|
|
..write('artist: $artist, ')
|
|
..write('album: $album, ')
|
|
..write('durationMs: $durationMs, ')
|
|
..write('coverPath: $coverPath, ')
|
|
..write('dateAddedMs: $dateAddedMs, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted, ')
|
|
..write('playCount: $playCount, ')
|
|
..write('categoriesEdited: $categoriesEdited, ')
|
|
..write('metadataEdited: $metadataEdited, ')
|
|
..write('lyrics: $lyrics, ')
|
|
..write('gainDb: $gainDb, ')
|
|
..write('cloudId: $cloudId, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $FoldersTable extends Folders with TableInfo<$FoldersTable, Folder> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$FoldersTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _pathMeta = const VerificationMeta('path');
|
|
@override
|
|
late final GeneratedColumn<String> path = GeneratedColumn<String>(
|
|
'path',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways('UNIQUE'),
|
|
);
|
|
static const VerificationMeta _updatedAtMsMeta = const VerificationMeta(
|
|
'updatedAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> updatedAtMs = GeneratedColumn<int>(
|
|
'updated_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedMeta = const VerificationMeta(
|
|
'deleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> deleted = GeneratedColumn<bool>(
|
|
'deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [id, path, updatedAtMs, deleted];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'folders';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Folder> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('path')) {
|
|
context.handle(
|
|
_pathMeta,
|
|
path.isAcceptableOrUnknown(data['path']!, _pathMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_pathMeta);
|
|
}
|
|
if (data.containsKey('updated_at_ms')) {
|
|
context.handle(
|
|
_updatedAtMsMeta,
|
|
updatedAtMs.isAcceptableOrUnknown(
|
|
data['updated_at_ms']!,
|
|
_updatedAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMsMeta);
|
|
}
|
|
if (data.containsKey('deleted')) {
|
|
context.handle(
|
|
_deletedMeta,
|
|
deleted.isAcceptableOrUnknown(data['deleted']!, _deletedMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Folder map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Folder(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
path: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}path'],
|
|
)!,
|
|
updatedAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}updated_at_ms'],
|
|
)!,
|
|
deleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}deleted'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$FoldersTable createAlias(String alias) {
|
|
return $FoldersTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Folder extends DataClass implements Insertable<Folder> {
|
|
final String id;
|
|
final String path;
|
|
final int updatedAtMs;
|
|
final bool deleted;
|
|
const Folder({
|
|
required this.id,
|
|
required this.path,
|
|
required this.updatedAtMs,
|
|
required this.deleted,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['path'] = Variable<String>(path);
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs);
|
|
map['deleted'] = Variable<bool>(deleted);
|
|
return map;
|
|
}
|
|
|
|
FoldersCompanion toCompanion(bool nullToAbsent) {
|
|
return FoldersCompanion(
|
|
id: Value(id),
|
|
path: Value(path),
|
|
updatedAtMs: Value(updatedAtMs),
|
|
deleted: Value(deleted),
|
|
);
|
|
}
|
|
|
|
factory Folder.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Folder(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
path: serializer.fromJson<String>(json['path']),
|
|
updatedAtMs: serializer.fromJson<int>(json['updatedAtMs']),
|
|
deleted: serializer.fromJson<bool>(json['deleted']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'path': serializer.toJson<String>(path),
|
|
'updatedAtMs': serializer.toJson<int>(updatedAtMs),
|
|
'deleted': serializer.toJson<bool>(deleted),
|
|
};
|
|
}
|
|
|
|
Folder copyWith({
|
|
String? id,
|
|
String? path,
|
|
int? updatedAtMs,
|
|
bool? deleted,
|
|
}) => Folder(
|
|
id: id ?? this.id,
|
|
path: path ?? this.path,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
);
|
|
Folder copyWithCompanion(FoldersCompanion data) {
|
|
return Folder(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
path: data.path.present ? data.path.value : this.path,
|
|
updatedAtMs: data.updatedAtMs.present
|
|
? data.updatedAtMs.value
|
|
: this.updatedAtMs,
|
|
deleted: data.deleted.present ? data.deleted.value : this.deleted,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Folder(')
|
|
..write('id: $id, ')
|
|
..write('path: $path, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(id, path, updatedAtMs, deleted);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Folder &&
|
|
other.id == this.id &&
|
|
other.path == this.path &&
|
|
other.updatedAtMs == this.updatedAtMs &&
|
|
other.deleted == this.deleted);
|
|
}
|
|
|
|
class FoldersCompanion extends UpdateCompanion<Folder> {
|
|
final Value<String> id;
|
|
final Value<String> path;
|
|
final Value<int> updatedAtMs;
|
|
final Value<bool> deleted;
|
|
final Value<int> rowid;
|
|
const FoldersCompanion({
|
|
this.id = const Value.absent(),
|
|
this.path = const Value.absent(),
|
|
this.updatedAtMs = const Value.absent(),
|
|
this.deleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
FoldersCompanion.insert({
|
|
required String id,
|
|
required String path,
|
|
required int updatedAtMs,
|
|
this.deleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
path = Value(path),
|
|
updatedAtMs = Value(updatedAtMs);
|
|
static Insertable<Folder> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? path,
|
|
Expression<int>? updatedAtMs,
|
|
Expression<bool>? deleted,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (path != null) 'path': path,
|
|
if (updatedAtMs != null) 'updated_at_ms': updatedAtMs,
|
|
if (deleted != null) 'deleted': deleted,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
FoldersCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? path,
|
|
Value<int>? updatedAtMs,
|
|
Value<bool>? deleted,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return FoldersCompanion(
|
|
id: id ?? this.id,
|
|
path: path ?? this.path,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (path.present) {
|
|
map['path'] = Variable<String>(path.value);
|
|
}
|
|
if (updatedAtMs.present) {
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs.value);
|
|
}
|
|
if (deleted.present) {
|
|
map['deleted'] = Variable<bool>(deleted.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FoldersCompanion(')
|
|
..write('id: $id, ')
|
|
..write('path: $path, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PlaylistsTable extends Playlists
|
|
with TableInfo<$PlaylistsTable, Playlist> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PlaylistsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _idMeta = const VerificationMeta('id');
|
|
@override
|
|
late final GeneratedColumn<String> id = GeneratedColumn<String>(
|
|
'id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _descriptionMeta = const VerificationMeta(
|
|
'description',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> description = GeneratedColumn<String>(
|
|
'description',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _createdAtMsMeta = const VerificationMeta(
|
|
'createdAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAtMs = GeneratedColumn<int>(
|
|
'created_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _updatedAtMsMeta = const VerificationMeta(
|
|
'updatedAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> updatedAtMs = GeneratedColumn<int>(
|
|
'updated_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _deletedMeta = const VerificationMeta(
|
|
'deleted',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<bool> deleted = GeneratedColumn<bool>(
|
|
'deleted',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.bool,
|
|
requiredDuringInsert: false,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'CHECK ("deleted" IN (0, 1))',
|
|
),
|
|
defaultValue: const Constant(false),
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
id,
|
|
name,
|
|
description,
|
|
createdAtMs,
|
|
updatedAtMs,
|
|
deleted,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'playlists';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Playlist> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('id')) {
|
|
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
|
|
} else if (isInserting) {
|
|
context.missing(_idMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('description')) {
|
|
context.handle(
|
|
_descriptionMeta,
|
|
description.isAcceptableOrUnknown(
|
|
data['description']!,
|
|
_descriptionMeta,
|
|
),
|
|
);
|
|
}
|
|
if (data.containsKey('created_at_ms')) {
|
|
context.handle(
|
|
_createdAtMsMeta,
|
|
createdAtMs.isAcceptableOrUnknown(
|
|
data['created_at_ms']!,
|
|
_createdAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMsMeta);
|
|
}
|
|
if (data.containsKey('updated_at_ms')) {
|
|
context.handle(
|
|
_updatedAtMsMeta,
|
|
updatedAtMs.isAcceptableOrUnknown(
|
|
data['updated_at_ms']!,
|
|
_updatedAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_updatedAtMsMeta);
|
|
}
|
|
if (data.containsKey('deleted')) {
|
|
context.handle(
|
|
_deletedMeta,
|
|
deleted.isAcceptableOrUnknown(data['deleted']!, _deletedMeta),
|
|
);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {id};
|
|
@override
|
|
Playlist map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Playlist(
|
|
id: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
description: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}description'],
|
|
),
|
|
createdAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at_ms'],
|
|
)!,
|
|
updatedAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}updated_at_ms'],
|
|
)!,
|
|
deleted: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.bool,
|
|
data['${effectivePrefix}deleted'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PlaylistsTable createAlias(String alias) {
|
|
return $PlaylistsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Playlist extends DataClass implements Insertable<Playlist> {
|
|
final String id;
|
|
final String name;
|
|
final String? description;
|
|
final int createdAtMs;
|
|
final int updatedAtMs;
|
|
final bool deleted;
|
|
const Playlist({
|
|
required this.id,
|
|
required this.name,
|
|
this.description,
|
|
required this.createdAtMs,
|
|
required this.updatedAtMs,
|
|
required this.deleted,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['id'] = Variable<String>(id);
|
|
map['name'] = Variable<String>(name);
|
|
if (!nullToAbsent || description != null) {
|
|
map['description'] = Variable<String>(description);
|
|
}
|
|
map['created_at_ms'] = Variable<int>(createdAtMs);
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs);
|
|
map['deleted'] = Variable<bool>(deleted);
|
|
return map;
|
|
}
|
|
|
|
PlaylistsCompanion toCompanion(bool nullToAbsent) {
|
|
return PlaylistsCompanion(
|
|
id: Value(id),
|
|
name: Value(name),
|
|
description: description == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(description),
|
|
createdAtMs: Value(createdAtMs),
|
|
updatedAtMs: Value(updatedAtMs),
|
|
deleted: Value(deleted),
|
|
);
|
|
}
|
|
|
|
factory Playlist.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Playlist(
|
|
id: serializer.fromJson<String>(json['id']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
description: serializer.fromJson<String?>(json['description']),
|
|
createdAtMs: serializer.fromJson<int>(json['createdAtMs']),
|
|
updatedAtMs: serializer.fromJson<int>(json['updatedAtMs']),
|
|
deleted: serializer.fromJson<bool>(json['deleted']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'id': serializer.toJson<String>(id),
|
|
'name': serializer.toJson<String>(name),
|
|
'description': serializer.toJson<String?>(description),
|
|
'createdAtMs': serializer.toJson<int>(createdAtMs),
|
|
'updatedAtMs': serializer.toJson<int>(updatedAtMs),
|
|
'deleted': serializer.toJson<bool>(deleted),
|
|
};
|
|
}
|
|
|
|
Playlist copyWith({
|
|
String? id,
|
|
String? name,
|
|
Value<String?> description = const Value.absent(),
|
|
int? createdAtMs,
|
|
int? updatedAtMs,
|
|
bool? deleted,
|
|
}) => Playlist(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
description: description.present ? description.value : this.description,
|
|
createdAtMs: createdAtMs ?? this.createdAtMs,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
);
|
|
Playlist copyWithCompanion(PlaylistsCompanion data) {
|
|
return Playlist(
|
|
id: data.id.present ? data.id.value : this.id,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
description: data.description.present
|
|
? data.description.value
|
|
: this.description,
|
|
createdAtMs: data.createdAtMs.present
|
|
? data.createdAtMs.value
|
|
: this.createdAtMs,
|
|
updatedAtMs: data.updatedAtMs.present
|
|
? data.updatedAtMs.value
|
|
: this.updatedAtMs,
|
|
deleted: data.deleted.present ? data.deleted.value : this.deleted,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Playlist(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('createdAtMs: $createdAtMs, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(id, name, description, createdAtMs, updatedAtMs, deleted);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Playlist &&
|
|
other.id == this.id &&
|
|
other.name == this.name &&
|
|
other.description == this.description &&
|
|
other.createdAtMs == this.createdAtMs &&
|
|
other.updatedAtMs == this.updatedAtMs &&
|
|
other.deleted == this.deleted);
|
|
}
|
|
|
|
class PlaylistsCompanion extends UpdateCompanion<Playlist> {
|
|
final Value<String> id;
|
|
final Value<String> name;
|
|
final Value<String?> description;
|
|
final Value<int> createdAtMs;
|
|
final Value<int> updatedAtMs;
|
|
final Value<bool> deleted;
|
|
final Value<int> rowid;
|
|
const PlaylistsCompanion({
|
|
this.id = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.description = const Value.absent(),
|
|
this.createdAtMs = const Value.absent(),
|
|
this.updatedAtMs = const Value.absent(),
|
|
this.deleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PlaylistsCompanion.insert({
|
|
required String id,
|
|
required String name,
|
|
this.description = const Value.absent(),
|
|
required int createdAtMs,
|
|
required int updatedAtMs,
|
|
this.deleted = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
}) : id = Value(id),
|
|
name = Value(name),
|
|
createdAtMs = Value(createdAtMs),
|
|
updatedAtMs = Value(updatedAtMs);
|
|
static Insertable<Playlist> custom({
|
|
Expression<String>? id,
|
|
Expression<String>? name,
|
|
Expression<String>? description,
|
|
Expression<int>? createdAtMs,
|
|
Expression<int>? updatedAtMs,
|
|
Expression<bool>? deleted,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (id != null) 'id': id,
|
|
if (name != null) 'name': name,
|
|
if (description != null) 'description': description,
|
|
if (createdAtMs != null) 'created_at_ms': createdAtMs,
|
|
if (updatedAtMs != null) 'updated_at_ms': updatedAtMs,
|
|
if (deleted != null) 'deleted': deleted,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PlaylistsCompanion copyWith({
|
|
Value<String>? id,
|
|
Value<String>? name,
|
|
Value<String?>? description,
|
|
Value<int>? createdAtMs,
|
|
Value<int>? updatedAtMs,
|
|
Value<bool>? deleted,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PlaylistsCompanion(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
description: description ?? this.description,
|
|
createdAtMs: createdAtMs ?? this.createdAtMs,
|
|
updatedAtMs: updatedAtMs ?? this.updatedAtMs,
|
|
deleted: deleted ?? this.deleted,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (id.present) {
|
|
map['id'] = Variable<String>(id.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (description.present) {
|
|
map['description'] = Variable<String>(description.value);
|
|
}
|
|
if (createdAtMs.present) {
|
|
map['created_at_ms'] = Variable<int>(createdAtMs.value);
|
|
}
|
|
if (updatedAtMs.present) {
|
|
map['updated_at_ms'] = Variable<int>(updatedAtMs.value);
|
|
}
|
|
if (deleted.present) {
|
|
map['deleted'] = Variable<bool>(deleted.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlaylistsCompanion(')
|
|
..write('id: $id, ')
|
|
..write('name: $name, ')
|
|
..write('description: $description, ')
|
|
..write('createdAtMs: $createdAtMs, ')
|
|
..write('updatedAtMs: $updatedAtMs, ')
|
|
..write('deleted: $deleted, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PlaylistSongsTable extends PlaylistSongs
|
|
with TableInfo<$PlaylistSongsTable, PlaylistSong> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PlaylistSongsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _playlistIdMeta = const VerificationMeta(
|
|
'playlistId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> playlistId = GeneratedColumn<String>(
|
|
'playlist_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES playlists (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _songIdMeta = const VerificationMeta('songId');
|
|
@override
|
|
late final GeneratedColumn<String> songId = GeneratedColumn<String>(
|
|
'song_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES songs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _positionMeta = const VerificationMeta(
|
|
'position',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _addedAtMsMeta = const VerificationMeta(
|
|
'addedAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> addedAtMs = GeneratedColumn<int>(
|
|
'added_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
playlistId,
|
|
songId,
|
|
position,
|
|
addedAtMs,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'playlist_songs';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<PlaylistSong> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('playlist_id')) {
|
|
context.handle(
|
|
_playlistIdMeta,
|
|
playlistId.isAcceptableOrUnknown(data['playlist_id']!, _playlistIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_playlistIdMeta);
|
|
}
|
|
if (data.containsKey('song_id')) {
|
|
context.handle(
|
|
_songIdMeta,
|
|
songId.isAcceptableOrUnknown(data['song_id']!, _songIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_songIdMeta);
|
|
}
|
|
if (data.containsKey('position')) {
|
|
context.handle(
|
|
_positionMeta,
|
|
position.isAcceptableOrUnknown(data['position']!, _positionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMeta);
|
|
}
|
|
if (data.containsKey('added_at_ms')) {
|
|
context.handle(
|
|
_addedAtMsMeta,
|
|
addedAtMs.isAcceptableOrUnknown(data['added_at_ms']!, _addedAtMsMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_addedAtMsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {playlistId, songId};
|
|
@override
|
|
PlaylistSong map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return PlaylistSong(
|
|
playlistId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}playlist_id'],
|
|
)!,
|
|
songId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}song_id'],
|
|
)!,
|
|
position: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position'],
|
|
)!,
|
|
addedAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}added_at_ms'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PlaylistSongsTable createAlias(String alias) {
|
|
return $PlaylistSongsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class PlaylistSong extends DataClass implements Insertable<PlaylistSong> {
|
|
final String playlistId;
|
|
final String songId;
|
|
final int position;
|
|
final int addedAtMs;
|
|
const PlaylistSong({
|
|
required this.playlistId,
|
|
required this.songId,
|
|
required this.position,
|
|
required this.addedAtMs,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['playlist_id'] = Variable<String>(playlistId);
|
|
map['song_id'] = Variable<String>(songId);
|
|
map['position'] = Variable<int>(position);
|
|
map['added_at_ms'] = Variable<int>(addedAtMs);
|
|
return map;
|
|
}
|
|
|
|
PlaylistSongsCompanion toCompanion(bool nullToAbsent) {
|
|
return PlaylistSongsCompanion(
|
|
playlistId: Value(playlistId),
|
|
songId: Value(songId),
|
|
position: Value(position),
|
|
addedAtMs: Value(addedAtMs),
|
|
);
|
|
}
|
|
|
|
factory PlaylistSong.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return PlaylistSong(
|
|
playlistId: serializer.fromJson<String>(json['playlistId']),
|
|
songId: serializer.fromJson<String>(json['songId']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
addedAtMs: serializer.fromJson<int>(json['addedAtMs']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'playlistId': serializer.toJson<String>(playlistId),
|
|
'songId': serializer.toJson<String>(songId),
|
|
'position': serializer.toJson<int>(position),
|
|
'addedAtMs': serializer.toJson<int>(addedAtMs),
|
|
};
|
|
}
|
|
|
|
PlaylistSong copyWith({
|
|
String? playlistId,
|
|
String? songId,
|
|
int? position,
|
|
int? addedAtMs,
|
|
}) => PlaylistSong(
|
|
playlistId: playlistId ?? this.playlistId,
|
|
songId: songId ?? this.songId,
|
|
position: position ?? this.position,
|
|
addedAtMs: addedAtMs ?? this.addedAtMs,
|
|
);
|
|
PlaylistSong copyWithCompanion(PlaylistSongsCompanion data) {
|
|
return PlaylistSong(
|
|
playlistId: data.playlistId.present
|
|
? data.playlistId.value
|
|
: this.playlistId,
|
|
songId: data.songId.present ? data.songId.value : this.songId,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
addedAtMs: data.addedAtMs.present ? data.addedAtMs.value : this.addedAtMs,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlaylistSong(')
|
|
..write('playlistId: $playlistId, ')
|
|
..write('songId: $songId, ')
|
|
..write('position: $position, ')
|
|
..write('addedAtMs: $addedAtMs')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(playlistId, songId, position, addedAtMs);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is PlaylistSong &&
|
|
other.playlistId == this.playlistId &&
|
|
other.songId == this.songId &&
|
|
other.position == this.position &&
|
|
other.addedAtMs == this.addedAtMs);
|
|
}
|
|
|
|
class PlaylistSongsCompanion extends UpdateCompanion<PlaylistSong> {
|
|
final Value<String> playlistId;
|
|
final Value<String> songId;
|
|
final Value<int> position;
|
|
final Value<int> addedAtMs;
|
|
final Value<int> rowid;
|
|
const PlaylistSongsCompanion({
|
|
this.playlistId = const Value.absent(),
|
|
this.songId = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.addedAtMs = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PlaylistSongsCompanion.insert({
|
|
required String playlistId,
|
|
required String songId,
|
|
required int position,
|
|
required int addedAtMs,
|
|
this.rowid = const Value.absent(),
|
|
}) : playlistId = Value(playlistId),
|
|
songId = Value(songId),
|
|
position = Value(position),
|
|
addedAtMs = Value(addedAtMs);
|
|
static Insertable<PlaylistSong> custom({
|
|
Expression<String>? playlistId,
|
|
Expression<String>? songId,
|
|
Expression<int>? position,
|
|
Expression<int>? addedAtMs,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (playlistId != null) 'playlist_id': playlistId,
|
|
if (songId != null) 'song_id': songId,
|
|
if (position != null) 'position': position,
|
|
if (addedAtMs != null) 'added_at_ms': addedAtMs,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PlaylistSongsCompanion copyWith({
|
|
Value<String>? playlistId,
|
|
Value<String>? songId,
|
|
Value<int>? position,
|
|
Value<int>? addedAtMs,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PlaylistSongsCompanion(
|
|
playlistId: playlistId ?? this.playlistId,
|
|
songId: songId ?? this.songId,
|
|
position: position ?? this.position,
|
|
addedAtMs: addedAtMs ?? this.addedAtMs,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (playlistId.present) {
|
|
map['playlist_id'] = Variable<String>(playlistId.value);
|
|
}
|
|
if (songId.present) {
|
|
map['song_id'] = Variable<String>(songId.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (addedAtMs.present) {
|
|
map['added_at_ms'] = Variable<int>(addedAtMs.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlaylistSongsCompanion(')
|
|
..write('playlistId: $playlistId, ')
|
|
..write('songId: $songId, ')
|
|
..write('position: $position, ')
|
|
..write('addedAtMs: $addedAtMs, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $FavoritesTable extends Favorites
|
|
with TableInfo<$FavoritesTable, Favorite> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$FavoritesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _songIdMeta = const VerificationMeta('songId');
|
|
@override
|
|
late final GeneratedColumn<String> songId = GeneratedColumn<String>(
|
|
'song_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES songs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _createdAtMsMeta = const VerificationMeta(
|
|
'createdAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> createdAtMs = GeneratedColumn<int>(
|
|
'created_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [songId, createdAtMs];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'favorites';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Favorite> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('song_id')) {
|
|
context.handle(
|
|
_songIdMeta,
|
|
songId.isAcceptableOrUnknown(data['song_id']!, _songIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_songIdMeta);
|
|
}
|
|
if (data.containsKey('created_at_ms')) {
|
|
context.handle(
|
|
_createdAtMsMeta,
|
|
createdAtMs.isAcceptableOrUnknown(
|
|
data['created_at_ms']!,
|
|
_createdAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_createdAtMsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {songId};
|
|
@override
|
|
Favorite map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Favorite(
|
|
songId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}song_id'],
|
|
)!,
|
|
createdAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}created_at_ms'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$FavoritesTable createAlias(String alias) {
|
|
return $FavoritesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Favorite extends DataClass implements Insertable<Favorite> {
|
|
final String songId;
|
|
final int createdAtMs;
|
|
const Favorite({required this.songId, required this.createdAtMs});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['song_id'] = Variable<String>(songId);
|
|
map['created_at_ms'] = Variable<int>(createdAtMs);
|
|
return map;
|
|
}
|
|
|
|
FavoritesCompanion toCompanion(bool nullToAbsent) {
|
|
return FavoritesCompanion(
|
|
songId: Value(songId),
|
|
createdAtMs: Value(createdAtMs),
|
|
);
|
|
}
|
|
|
|
factory Favorite.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Favorite(
|
|
songId: serializer.fromJson<String>(json['songId']),
|
|
createdAtMs: serializer.fromJson<int>(json['createdAtMs']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'songId': serializer.toJson<String>(songId),
|
|
'createdAtMs': serializer.toJson<int>(createdAtMs),
|
|
};
|
|
}
|
|
|
|
Favorite copyWith({String? songId, int? createdAtMs}) => Favorite(
|
|
songId: songId ?? this.songId,
|
|
createdAtMs: createdAtMs ?? this.createdAtMs,
|
|
);
|
|
Favorite copyWithCompanion(FavoritesCompanion data) {
|
|
return Favorite(
|
|
songId: data.songId.present ? data.songId.value : this.songId,
|
|
createdAtMs: data.createdAtMs.present
|
|
? data.createdAtMs.value
|
|
: this.createdAtMs,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Favorite(')
|
|
..write('songId: $songId, ')
|
|
..write('createdAtMs: $createdAtMs')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(songId, createdAtMs);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Favorite &&
|
|
other.songId == this.songId &&
|
|
other.createdAtMs == this.createdAtMs);
|
|
}
|
|
|
|
class FavoritesCompanion extends UpdateCompanion<Favorite> {
|
|
final Value<String> songId;
|
|
final Value<int> createdAtMs;
|
|
final Value<int> rowid;
|
|
const FavoritesCompanion({
|
|
this.songId = const Value.absent(),
|
|
this.createdAtMs = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
FavoritesCompanion.insert({
|
|
required String songId,
|
|
required int createdAtMs,
|
|
this.rowid = const Value.absent(),
|
|
}) : songId = Value(songId),
|
|
createdAtMs = Value(createdAtMs);
|
|
static Insertable<Favorite> custom({
|
|
Expression<String>? songId,
|
|
Expression<int>? createdAtMs,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (songId != null) 'song_id': songId,
|
|
if (createdAtMs != null) 'created_at_ms': createdAtMs,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
FavoritesCompanion copyWith({
|
|
Value<String>? songId,
|
|
Value<int>? createdAtMs,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return FavoritesCompanion(
|
|
songId: songId ?? this.songId,
|
|
createdAtMs: createdAtMs ?? this.createdAtMs,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (songId.present) {
|
|
map['song_id'] = Variable<String>(songId.value);
|
|
}
|
|
if (createdAtMs.present) {
|
|
map['created_at_ms'] = Variable<int>(createdAtMs.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('FavoritesCompanion(')
|
|
..write('songId: $songId, ')
|
|
..write('createdAtMs: $createdAtMs, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $PlaybackHistoryTable extends PlaybackHistory
|
|
with TableInfo<$PlaybackHistoryTable, PlaybackHistoryData> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$PlaybackHistoryTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _songIdMeta = const VerificationMeta('songId');
|
|
@override
|
|
late final GeneratedColumn<String> songId = GeneratedColumn<String>(
|
|
'song_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES songs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _positionMsMeta = const VerificationMeta(
|
|
'positionMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> positionMs = GeneratedColumn<int>(
|
|
'position_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _playedAtMsMeta = const VerificationMeta(
|
|
'playedAtMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> playedAtMs = GeneratedColumn<int>(
|
|
'played_at_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [songId, positionMs, playedAtMs];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'playback_history';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<PlaybackHistoryData> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('song_id')) {
|
|
context.handle(
|
|
_songIdMeta,
|
|
songId.isAcceptableOrUnknown(data['song_id']!, _songIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_songIdMeta);
|
|
}
|
|
if (data.containsKey('position_ms')) {
|
|
context.handle(
|
|
_positionMsMeta,
|
|
positionMs.isAcceptableOrUnknown(data['position_ms']!, _positionMsMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMsMeta);
|
|
}
|
|
if (data.containsKey('played_at_ms')) {
|
|
context.handle(
|
|
_playedAtMsMeta,
|
|
playedAtMs.isAcceptableOrUnknown(
|
|
data['played_at_ms']!,
|
|
_playedAtMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_playedAtMsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {songId, playedAtMs};
|
|
@override
|
|
PlaybackHistoryData map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return PlaybackHistoryData(
|
|
songId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}song_id'],
|
|
)!,
|
|
positionMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position_ms'],
|
|
)!,
|
|
playedAtMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}played_at_ms'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$PlaybackHistoryTable createAlias(String alias) {
|
|
return $PlaybackHistoryTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class PlaybackHistoryData extends DataClass
|
|
implements Insertable<PlaybackHistoryData> {
|
|
final String songId;
|
|
final int positionMs;
|
|
final int playedAtMs;
|
|
const PlaybackHistoryData({
|
|
required this.songId,
|
|
required this.positionMs,
|
|
required this.playedAtMs,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['song_id'] = Variable<String>(songId);
|
|
map['position_ms'] = Variable<int>(positionMs);
|
|
map['played_at_ms'] = Variable<int>(playedAtMs);
|
|
return map;
|
|
}
|
|
|
|
PlaybackHistoryCompanion toCompanion(bool nullToAbsent) {
|
|
return PlaybackHistoryCompanion(
|
|
songId: Value(songId),
|
|
positionMs: Value(positionMs),
|
|
playedAtMs: Value(playedAtMs),
|
|
);
|
|
}
|
|
|
|
factory PlaybackHistoryData.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return PlaybackHistoryData(
|
|
songId: serializer.fromJson<String>(json['songId']),
|
|
positionMs: serializer.fromJson<int>(json['positionMs']),
|
|
playedAtMs: serializer.fromJson<int>(json['playedAtMs']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'songId': serializer.toJson<String>(songId),
|
|
'positionMs': serializer.toJson<int>(positionMs),
|
|
'playedAtMs': serializer.toJson<int>(playedAtMs),
|
|
};
|
|
}
|
|
|
|
PlaybackHistoryData copyWith({
|
|
String? songId,
|
|
int? positionMs,
|
|
int? playedAtMs,
|
|
}) => PlaybackHistoryData(
|
|
songId: songId ?? this.songId,
|
|
positionMs: positionMs ?? this.positionMs,
|
|
playedAtMs: playedAtMs ?? this.playedAtMs,
|
|
);
|
|
PlaybackHistoryData copyWithCompanion(PlaybackHistoryCompanion data) {
|
|
return PlaybackHistoryData(
|
|
songId: data.songId.present ? data.songId.value : this.songId,
|
|
positionMs: data.positionMs.present
|
|
? data.positionMs.value
|
|
: this.positionMs,
|
|
playedAtMs: data.playedAtMs.present
|
|
? data.playedAtMs.value
|
|
: this.playedAtMs,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlaybackHistoryData(')
|
|
..write('songId: $songId, ')
|
|
..write('positionMs: $positionMs, ')
|
|
..write('playedAtMs: $playedAtMs')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(songId, positionMs, playedAtMs);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is PlaybackHistoryData &&
|
|
other.songId == this.songId &&
|
|
other.positionMs == this.positionMs &&
|
|
other.playedAtMs == this.playedAtMs);
|
|
}
|
|
|
|
class PlaybackHistoryCompanion extends UpdateCompanion<PlaybackHistoryData> {
|
|
final Value<String> songId;
|
|
final Value<int> positionMs;
|
|
final Value<int> playedAtMs;
|
|
final Value<int> rowid;
|
|
const PlaybackHistoryCompanion({
|
|
this.songId = const Value.absent(),
|
|
this.positionMs = const Value.absent(),
|
|
this.playedAtMs = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
PlaybackHistoryCompanion.insert({
|
|
required String songId,
|
|
required int positionMs,
|
|
required int playedAtMs,
|
|
this.rowid = const Value.absent(),
|
|
}) : songId = Value(songId),
|
|
positionMs = Value(positionMs),
|
|
playedAtMs = Value(playedAtMs);
|
|
static Insertable<PlaybackHistoryData> custom({
|
|
Expression<String>? songId,
|
|
Expression<int>? positionMs,
|
|
Expression<int>? playedAtMs,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (songId != null) 'song_id': songId,
|
|
if (positionMs != null) 'position_ms': positionMs,
|
|
if (playedAtMs != null) 'played_at_ms': playedAtMs,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
PlaybackHistoryCompanion copyWith({
|
|
Value<String>? songId,
|
|
Value<int>? positionMs,
|
|
Value<int>? playedAtMs,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return PlaybackHistoryCompanion(
|
|
songId: songId ?? this.songId,
|
|
positionMs: positionMs ?? this.positionMs,
|
|
playedAtMs: playedAtMs ?? this.playedAtMs,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (songId.present) {
|
|
map['song_id'] = Variable<String>(songId.value);
|
|
}
|
|
if (positionMs.present) {
|
|
map['position_ms'] = Variable<int>(positionMs.value);
|
|
}
|
|
if (playedAtMs.present) {
|
|
map['played_at_ms'] = Variable<int>(playedAtMs.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('PlaybackHistoryCompanion(')
|
|
..write('songId: $songId, ')
|
|
..write('positionMs: $positionMs, ')
|
|
..write('playedAtMs: $playedAtMs, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $SongCategoriesTable extends SongCategories
|
|
with TableInfo<$SongCategoriesTable, SongCategory> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$SongCategoriesTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _songIdMeta = const VerificationMeta('songId');
|
|
@override
|
|
late final GeneratedColumn<String> songId = GeneratedColumn<String>(
|
|
'song_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
|
'REFERENCES songs (id)',
|
|
),
|
|
);
|
|
static const VerificationMeta _nameMeta = const VerificationMeta('name');
|
|
@override
|
|
late final GeneratedColumn<String> name = GeneratedColumn<String>(
|
|
'name',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _positionMeta = const VerificationMeta(
|
|
'position',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> position = GeneratedColumn<int>(
|
|
'position',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [songId, name, position];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'song_categories';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<SongCategory> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('song_id')) {
|
|
context.handle(
|
|
_songIdMeta,
|
|
songId.isAcceptableOrUnknown(data['song_id']!, _songIdMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_songIdMeta);
|
|
}
|
|
if (data.containsKey('name')) {
|
|
context.handle(
|
|
_nameMeta,
|
|
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_nameMeta);
|
|
}
|
|
if (data.containsKey('position')) {
|
|
context.handle(
|
|
_positionMeta,
|
|
position.isAcceptableOrUnknown(data['position']!, _positionMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_positionMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {songId, name};
|
|
@override
|
|
SongCategory map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return SongCategory(
|
|
songId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}song_id'],
|
|
)!,
|
|
name: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}name'],
|
|
)!,
|
|
position: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}position'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$SongCategoriesTable createAlias(String alias) {
|
|
return $SongCategoriesTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class SongCategory extends DataClass implements Insertable<SongCategory> {
|
|
final String songId;
|
|
final String name;
|
|
final int position;
|
|
const SongCategory({
|
|
required this.songId,
|
|
required this.name,
|
|
required this.position,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['song_id'] = Variable<String>(songId);
|
|
map['name'] = Variable<String>(name);
|
|
map['position'] = Variable<int>(position);
|
|
return map;
|
|
}
|
|
|
|
SongCategoriesCompanion toCompanion(bool nullToAbsent) {
|
|
return SongCategoriesCompanion(
|
|
songId: Value(songId),
|
|
name: Value(name),
|
|
position: Value(position),
|
|
);
|
|
}
|
|
|
|
factory SongCategory.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return SongCategory(
|
|
songId: serializer.fromJson<String>(json['songId']),
|
|
name: serializer.fromJson<String>(json['name']),
|
|
position: serializer.fromJson<int>(json['position']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'songId': serializer.toJson<String>(songId),
|
|
'name': serializer.toJson<String>(name),
|
|
'position': serializer.toJson<int>(position),
|
|
};
|
|
}
|
|
|
|
SongCategory copyWith({String? songId, String? name, int? position}) =>
|
|
SongCategory(
|
|
songId: songId ?? this.songId,
|
|
name: name ?? this.name,
|
|
position: position ?? this.position,
|
|
);
|
|
SongCategory copyWithCompanion(SongCategoriesCompanion data) {
|
|
return SongCategory(
|
|
songId: data.songId.present ? data.songId.value : this.songId,
|
|
name: data.name.present ? data.name.value : this.name,
|
|
position: data.position.present ? data.position.value : this.position,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SongCategory(')
|
|
..write('songId: $songId, ')
|
|
..write('name: $name, ')
|
|
..write('position: $position')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(songId, name, position);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is SongCategory &&
|
|
other.songId == this.songId &&
|
|
other.name == this.name &&
|
|
other.position == this.position);
|
|
}
|
|
|
|
class SongCategoriesCompanion extends UpdateCompanion<SongCategory> {
|
|
final Value<String> songId;
|
|
final Value<String> name;
|
|
final Value<int> position;
|
|
final Value<int> rowid;
|
|
const SongCategoriesCompanion({
|
|
this.songId = const Value.absent(),
|
|
this.name = const Value.absent(),
|
|
this.position = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
SongCategoriesCompanion.insert({
|
|
required String songId,
|
|
required String name,
|
|
required int position,
|
|
this.rowid = const Value.absent(),
|
|
}) : songId = Value(songId),
|
|
name = Value(name),
|
|
position = Value(position);
|
|
static Insertable<SongCategory> custom({
|
|
Expression<String>? songId,
|
|
Expression<String>? name,
|
|
Expression<int>? position,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (songId != null) 'song_id': songId,
|
|
if (name != null) 'name': name,
|
|
if (position != null) 'position': position,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
SongCategoriesCompanion copyWith({
|
|
Value<String>? songId,
|
|
Value<String>? name,
|
|
Value<int>? position,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return SongCategoriesCompanion(
|
|
songId: songId ?? this.songId,
|
|
name: name ?? this.name,
|
|
position: position ?? this.position,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (songId.present) {
|
|
map['song_id'] = Variable<String>(songId.value);
|
|
}
|
|
if (name.present) {
|
|
map['name'] = Variable<String>(name.value);
|
|
}
|
|
if (position.present) {
|
|
map['position'] = Variable<int>(position.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('SongCategoriesCompanion(')
|
|
..write('songId: $songId, ')
|
|
..write('name: $name, ')
|
|
..write('position: $position, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
class $DownloadsTable extends Downloads
|
|
with TableInfo<$DownloadsTable, Download> {
|
|
@override
|
|
final GeneratedDatabase attachedDatabase;
|
|
final String? _alias;
|
|
$DownloadsTable(this.attachedDatabase, [this._alias]);
|
|
static const VerificationMeta _navidromeIdMeta = const VerificationMeta(
|
|
'navidromeId',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> navidromeId = GeneratedColumn<String>(
|
|
'navidrome_id',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _titelMeta = const VerificationMeta('titel');
|
|
@override
|
|
late final GeneratedColumn<String> titel = GeneratedColumn<String>(
|
|
'titel',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _kuenstlerMeta = const VerificationMeta(
|
|
'kuenstler',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<String> kuenstler = GeneratedColumn<String>(
|
|
'kuenstler',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _albumMeta = const VerificationMeta('album');
|
|
@override
|
|
late final GeneratedColumn<String> album = GeneratedColumn<String>(
|
|
'album',
|
|
aliasedName,
|
|
true,
|
|
type: DriftSqlType.string,
|
|
requiredDuringInsert: false,
|
|
);
|
|
static const VerificationMeta _groesseBytesMeta = const VerificationMeta(
|
|
'groesseBytes',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> groesseBytes = GeneratedColumn<int>(
|
|
'groesse_bytes',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
static const VerificationMeta _geladenAmMsMeta = const VerificationMeta(
|
|
'geladenAmMs',
|
|
);
|
|
@override
|
|
late final GeneratedColumn<int> geladenAmMs = GeneratedColumn<int>(
|
|
'geladen_am_ms',
|
|
aliasedName,
|
|
false,
|
|
type: DriftSqlType.int,
|
|
requiredDuringInsert: true,
|
|
);
|
|
@override
|
|
List<GeneratedColumn> get $columns => [
|
|
navidromeId,
|
|
titel,
|
|
kuenstler,
|
|
album,
|
|
groesseBytes,
|
|
geladenAmMs,
|
|
];
|
|
@override
|
|
String get aliasedName => _alias ?? actualTableName;
|
|
@override
|
|
String get actualTableName => $name;
|
|
static const String $name = 'downloads';
|
|
@override
|
|
VerificationContext validateIntegrity(
|
|
Insertable<Download> instance, {
|
|
bool isInserting = false,
|
|
}) {
|
|
final context = VerificationContext();
|
|
final data = instance.toColumns(true);
|
|
if (data.containsKey('navidrome_id')) {
|
|
context.handle(
|
|
_navidromeIdMeta,
|
|
navidromeId.isAcceptableOrUnknown(
|
|
data['navidrome_id']!,
|
|
_navidromeIdMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_navidromeIdMeta);
|
|
}
|
|
if (data.containsKey('titel')) {
|
|
context.handle(
|
|
_titelMeta,
|
|
titel.isAcceptableOrUnknown(data['titel']!, _titelMeta),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_titelMeta);
|
|
}
|
|
if (data.containsKey('kuenstler')) {
|
|
context.handle(
|
|
_kuenstlerMeta,
|
|
kuenstler.isAcceptableOrUnknown(data['kuenstler']!, _kuenstlerMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('album')) {
|
|
context.handle(
|
|
_albumMeta,
|
|
album.isAcceptableOrUnknown(data['album']!, _albumMeta),
|
|
);
|
|
}
|
|
if (data.containsKey('groesse_bytes')) {
|
|
context.handle(
|
|
_groesseBytesMeta,
|
|
groesseBytes.isAcceptableOrUnknown(
|
|
data['groesse_bytes']!,
|
|
_groesseBytesMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_groesseBytesMeta);
|
|
}
|
|
if (data.containsKey('geladen_am_ms')) {
|
|
context.handle(
|
|
_geladenAmMsMeta,
|
|
geladenAmMs.isAcceptableOrUnknown(
|
|
data['geladen_am_ms']!,
|
|
_geladenAmMsMeta,
|
|
),
|
|
);
|
|
} else if (isInserting) {
|
|
context.missing(_geladenAmMsMeta);
|
|
}
|
|
return context;
|
|
}
|
|
|
|
@override
|
|
Set<GeneratedColumn> get $primaryKey => {navidromeId};
|
|
@override
|
|
Download map(Map<String, dynamic> data, {String? tablePrefix}) {
|
|
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
|
|
return Download(
|
|
navidromeId: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}navidrome_id'],
|
|
)!,
|
|
titel: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}titel'],
|
|
)!,
|
|
kuenstler: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}kuenstler'],
|
|
),
|
|
album: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.string,
|
|
data['${effectivePrefix}album'],
|
|
),
|
|
groesseBytes: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}groesse_bytes'],
|
|
)!,
|
|
geladenAmMs: attachedDatabase.typeMapping.read(
|
|
DriftSqlType.int,
|
|
data['${effectivePrefix}geladen_am_ms'],
|
|
)!,
|
|
);
|
|
}
|
|
|
|
@override
|
|
$DownloadsTable createAlias(String alias) {
|
|
return $DownloadsTable(attachedDatabase, alias);
|
|
}
|
|
}
|
|
|
|
class Download extends DataClass implements Insertable<Download> {
|
|
final String navidromeId;
|
|
final String titel;
|
|
final String? kuenstler;
|
|
final String? album;
|
|
final int groesseBytes;
|
|
final int geladenAmMs;
|
|
const Download({
|
|
required this.navidromeId,
|
|
required this.titel,
|
|
this.kuenstler,
|
|
this.album,
|
|
required this.groesseBytes,
|
|
required this.geladenAmMs,
|
|
});
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
map['navidrome_id'] = Variable<String>(navidromeId);
|
|
map['titel'] = Variable<String>(titel);
|
|
if (!nullToAbsent || kuenstler != null) {
|
|
map['kuenstler'] = Variable<String>(kuenstler);
|
|
}
|
|
if (!nullToAbsent || album != null) {
|
|
map['album'] = Variable<String>(album);
|
|
}
|
|
map['groesse_bytes'] = Variable<int>(groesseBytes);
|
|
map['geladen_am_ms'] = Variable<int>(geladenAmMs);
|
|
return map;
|
|
}
|
|
|
|
DownloadsCompanion toCompanion(bool nullToAbsent) {
|
|
return DownloadsCompanion(
|
|
navidromeId: Value(navidromeId),
|
|
titel: Value(titel),
|
|
kuenstler: kuenstler == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(kuenstler),
|
|
album: album == null && nullToAbsent
|
|
? const Value.absent()
|
|
: Value(album),
|
|
groesseBytes: Value(groesseBytes),
|
|
geladenAmMs: Value(geladenAmMs),
|
|
);
|
|
}
|
|
|
|
factory Download.fromJson(
|
|
Map<String, dynamic> json, {
|
|
ValueSerializer? serializer,
|
|
}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return Download(
|
|
navidromeId: serializer.fromJson<String>(json['navidromeId']),
|
|
titel: serializer.fromJson<String>(json['titel']),
|
|
kuenstler: serializer.fromJson<String?>(json['kuenstler']),
|
|
album: serializer.fromJson<String?>(json['album']),
|
|
groesseBytes: serializer.fromJson<int>(json['groesseBytes']),
|
|
geladenAmMs: serializer.fromJson<int>(json['geladenAmMs']),
|
|
);
|
|
}
|
|
@override
|
|
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
|
|
serializer ??= driftRuntimeOptions.defaultSerializer;
|
|
return <String, dynamic>{
|
|
'navidromeId': serializer.toJson<String>(navidromeId),
|
|
'titel': serializer.toJson<String>(titel),
|
|
'kuenstler': serializer.toJson<String?>(kuenstler),
|
|
'album': serializer.toJson<String?>(album),
|
|
'groesseBytes': serializer.toJson<int>(groesseBytes),
|
|
'geladenAmMs': serializer.toJson<int>(geladenAmMs),
|
|
};
|
|
}
|
|
|
|
Download copyWith({
|
|
String? navidromeId,
|
|
String? titel,
|
|
Value<String?> kuenstler = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
int? groesseBytes,
|
|
int? geladenAmMs,
|
|
}) => Download(
|
|
navidromeId: navidromeId ?? this.navidromeId,
|
|
titel: titel ?? this.titel,
|
|
kuenstler: kuenstler.present ? kuenstler.value : this.kuenstler,
|
|
album: album.present ? album.value : this.album,
|
|
groesseBytes: groesseBytes ?? this.groesseBytes,
|
|
geladenAmMs: geladenAmMs ?? this.geladenAmMs,
|
|
);
|
|
Download copyWithCompanion(DownloadsCompanion data) {
|
|
return Download(
|
|
navidromeId: data.navidromeId.present
|
|
? data.navidromeId.value
|
|
: this.navidromeId,
|
|
titel: data.titel.present ? data.titel.value : this.titel,
|
|
kuenstler: data.kuenstler.present ? data.kuenstler.value : this.kuenstler,
|
|
album: data.album.present ? data.album.value : this.album,
|
|
groesseBytes: data.groesseBytes.present
|
|
? data.groesseBytes.value
|
|
: this.groesseBytes,
|
|
geladenAmMs: data.geladenAmMs.present
|
|
? data.geladenAmMs.value
|
|
: this.geladenAmMs,
|
|
);
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('Download(')
|
|
..write('navidromeId: $navidromeId, ')
|
|
..write('titel: $titel, ')
|
|
..write('kuenstler: $kuenstler, ')
|
|
..write('album: $album, ')
|
|
..write('groesseBytes: $groesseBytes, ')
|
|
..write('geladenAmMs: $geladenAmMs')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
navidromeId,
|
|
titel,
|
|
kuenstler,
|
|
album,
|
|
groesseBytes,
|
|
geladenAmMs,
|
|
);
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
(other is Download &&
|
|
other.navidromeId == this.navidromeId &&
|
|
other.titel == this.titel &&
|
|
other.kuenstler == this.kuenstler &&
|
|
other.album == this.album &&
|
|
other.groesseBytes == this.groesseBytes &&
|
|
other.geladenAmMs == this.geladenAmMs);
|
|
}
|
|
|
|
class DownloadsCompanion extends UpdateCompanion<Download> {
|
|
final Value<String> navidromeId;
|
|
final Value<String> titel;
|
|
final Value<String?> kuenstler;
|
|
final Value<String?> album;
|
|
final Value<int> groesseBytes;
|
|
final Value<int> geladenAmMs;
|
|
final Value<int> rowid;
|
|
const DownloadsCompanion({
|
|
this.navidromeId = const Value.absent(),
|
|
this.titel = const Value.absent(),
|
|
this.kuenstler = const Value.absent(),
|
|
this.album = const Value.absent(),
|
|
this.groesseBytes = const Value.absent(),
|
|
this.geladenAmMs = const Value.absent(),
|
|
this.rowid = const Value.absent(),
|
|
});
|
|
DownloadsCompanion.insert({
|
|
required String navidromeId,
|
|
required String titel,
|
|
this.kuenstler = const Value.absent(),
|
|
this.album = const Value.absent(),
|
|
required int groesseBytes,
|
|
required int geladenAmMs,
|
|
this.rowid = const Value.absent(),
|
|
}) : navidromeId = Value(navidromeId),
|
|
titel = Value(titel),
|
|
groesseBytes = Value(groesseBytes),
|
|
geladenAmMs = Value(geladenAmMs);
|
|
static Insertable<Download> custom({
|
|
Expression<String>? navidromeId,
|
|
Expression<String>? titel,
|
|
Expression<String>? kuenstler,
|
|
Expression<String>? album,
|
|
Expression<int>? groesseBytes,
|
|
Expression<int>? geladenAmMs,
|
|
Expression<int>? rowid,
|
|
}) {
|
|
return RawValuesInsertable({
|
|
if (navidromeId != null) 'navidrome_id': navidromeId,
|
|
if (titel != null) 'titel': titel,
|
|
if (kuenstler != null) 'kuenstler': kuenstler,
|
|
if (album != null) 'album': album,
|
|
if (groesseBytes != null) 'groesse_bytes': groesseBytes,
|
|
if (geladenAmMs != null) 'geladen_am_ms': geladenAmMs,
|
|
if (rowid != null) 'rowid': rowid,
|
|
});
|
|
}
|
|
|
|
DownloadsCompanion copyWith({
|
|
Value<String>? navidromeId,
|
|
Value<String>? titel,
|
|
Value<String?>? kuenstler,
|
|
Value<String?>? album,
|
|
Value<int>? groesseBytes,
|
|
Value<int>? geladenAmMs,
|
|
Value<int>? rowid,
|
|
}) {
|
|
return DownloadsCompanion(
|
|
navidromeId: navidromeId ?? this.navidromeId,
|
|
titel: titel ?? this.titel,
|
|
kuenstler: kuenstler ?? this.kuenstler,
|
|
album: album ?? this.album,
|
|
groesseBytes: groesseBytes ?? this.groesseBytes,
|
|
geladenAmMs: geladenAmMs ?? this.geladenAmMs,
|
|
rowid: rowid ?? this.rowid,
|
|
);
|
|
}
|
|
|
|
@override
|
|
Map<String, Expression> toColumns(bool nullToAbsent) {
|
|
final map = <String, Expression>{};
|
|
if (navidromeId.present) {
|
|
map['navidrome_id'] = Variable<String>(navidromeId.value);
|
|
}
|
|
if (titel.present) {
|
|
map['titel'] = Variable<String>(titel.value);
|
|
}
|
|
if (kuenstler.present) {
|
|
map['kuenstler'] = Variable<String>(kuenstler.value);
|
|
}
|
|
if (album.present) {
|
|
map['album'] = Variable<String>(album.value);
|
|
}
|
|
if (groesseBytes.present) {
|
|
map['groesse_bytes'] = Variable<int>(groesseBytes.value);
|
|
}
|
|
if (geladenAmMs.present) {
|
|
map['geladen_am_ms'] = Variable<int>(geladenAmMs.value);
|
|
}
|
|
if (rowid.present) {
|
|
map['rowid'] = Variable<int>(rowid.value);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (StringBuffer('DownloadsCompanion(')
|
|
..write('navidromeId: $navidromeId, ')
|
|
..write('titel: $titel, ')
|
|
..write('kuenstler: $kuenstler, ')
|
|
..write('album: $album, ')
|
|
..write('groesseBytes: $groesseBytes, ')
|
|
..write('geladenAmMs: $geladenAmMs, ')
|
|
..write('rowid: $rowid')
|
|
..write(')'))
|
|
.toString();
|
|
}
|
|
}
|
|
|
|
abstract class _$MeloDb extends GeneratedDatabase {
|
|
_$MeloDb(QueryExecutor e) : super(e);
|
|
$MeloDbManager get managers => $MeloDbManager(this);
|
|
late final $SongsTable songs = $SongsTable(this);
|
|
late final $FoldersTable folders = $FoldersTable(this);
|
|
late final $PlaylistsTable playlists = $PlaylistsTable(this);
|
|
late final $PlaylistSongsTable playlistSongs = $PlaylistSongsTable(this);
|
|
late final $FavoritesTable favorites = $FavoritesTable(this);
|
|
late final $PlaybackHistoryTable playbackHistory = $PlaybackHistoryTable(
|
|
this,
|
|
);
|
|
late final $SongCategoriesTable songCategories = $SongCategoriesTable(this);
|
|
late final $DownloadsTable downloads = $DownloadsTable(this);
|
|
@override
|
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
|
@override
|
|
List<DatabaseSchemaEntity> get allSchemaEntities => [
|
|
songs,
|
|
folders,
|
|
playlists,
|
|
playlistSongs,
|
|
favorites,
|
|
playbackHistory,
|
|
songCategories,
|
|
downloads,
|
|
];
|
|
}
|
|
|
|
typedef $$SongsTableCreateCompanionBuilder =
|
|
SongsCompanion Function({
|
|
required String id,
|
|
required String path,
|
|
required String title,
|
|
Value<String?> artist,
|
|
Value<String?> album,
|
|
Value<int?> durationMs,
|
|
Value<String?> coverPath,
|
|
required int dateAddedMs,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> playCount,
|
|
Value<bool> categoriesEdited,
|
|
Value<bool> metadataEdited,
|
|
Value<String?> lyrics,
|
|
Value<double?> gainDb,
|
|
Value<String?> cloudId,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$SongsTableUpdateCompanionBuilder =
|
|
SongsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> path,
|
|
Value<String> title,
|
|
Value<String?> artist,
|
|
Value<String?> album,
|
|
Value<int?> durationMs,
|
|
Value<String?> coverPath,
|
|
Value<int> dateAddedMs,
|
|
Value<int> updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> playCount,
|
|
Value<bool> categoriesEdited,
|
|
Value<bool> metadataEdited,
|
|
Value<String?> lyrics,
|
|
Value<double?> gainDb,
|
|
Value<String?> cloudId,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$SongsTableReferences
|
|
extends BaseReferences<_$MeloDb, $SongsTable, Song> {
|
|
$$SongsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$PlaylistSongsTable, List<PlaylistSong>>
|
|
_playlistSongsRefsTable(_$MeloDb db) => MultiTypedResultKey.fromTable(
|
|
db.playlistSongs,
|
|
aliasName: 'songs__id__playlist_songs__song_id',
|
|
);
|
|
|
|
$$PlaylistSongsTableProcessedTableManager get playlistSongsRefs {
|
|
final manager = $$PlaylistSongsTableTableManager(
|
|
$_db,
|
|
$_db.playlistSongs,
|
|
).filter((f) => f.songId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_playlistSongsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$FavoritesTable, List<Favorite>>
|
|
_favoritesRefsTable(_$MeloDb db) => MultiTypedResultKey.fromTable(
|
|
db.favorites,
|
|
aliasName: 'songs__id__favorites__song_id',
|
|
);
|
|
|
|
$$FavoritesTableProcessedTableManager get favoritesRefs {
|
|
final manager = $$FavoritesTableTableManager(
|
|
$_db,
|
|
$_db.favorites,
|
|
).filter((f) => f.songId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_favoritesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$PlaybackHistoryTable, List<PlaybackHistoryData>>
|
|
_playbackHistoryRefsTable(_$MeloDb db) => MultiTypedResultKey.fromTable(
|
|
db.playbackHistory,
|
|
aliasName: 'songs__id__playback_history__song_id',
|
|
);
|
|
|
|
$$PlaybackHistoryTableProcessedTableManager get playbackHistoryRefs {
|
|
final manager = $$PlaybackHistoryTableTableManager(
|
|
$_db,
|
|
$_db.playbackHistory,
|
|
).filter((f) => f.songId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(
|
|
_playbackHistoryRefsTable($_db),
|
|
);
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
|
|
static MultiTypedResultKey<$SongCategoriesTable, List<SongCategory>>
|
|
_songCategoriesRefsTable(_$MeloDb db) => MultiTypedResultKey.fromTable(
|
|
db.songCategories,
|
|
aliasName: 'songs__id__song_categories__song_id',
|
|
);
|
|
|
|
$$SongCategoriesTableProcessedTableManager get songCategoriesRefs {
|
|
final manager = $$SongCategoriesTableTableManager(
|
|
$_db,
|
|
$_db.songCategories,
|
|
).filter((f) => f.songId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_songCategoriesRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$SongsTableFilterComposer extends Composer<_$MeloDb, $SongsTable> {
|
|
$$SongsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get path => $composableBuilder(
|
|
column: $table.path,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get artist => $composableBuilder(
|
|
column: $table.artist,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get album => $composableBuilder(
|
|
column: $table.album,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get coverPath => $composableBuilder(
|
|
column: $table.coverPath,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get dateAddedMs => $composableBuilder(
|
|
column: $table.dateAddedMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get playCount => $composableBuilder(
|
|
column: $table.playCount,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get categoriesEdited => $composableBuilder(
|
|
column: $table.categoriesEdited,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get metadataEdited => $composableBuilder(
|
|
column: $table.metadataEdited,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get lyrics => $composableBuilder(
|
|
column: $table.lyrics,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<double> get gainDb => $composableBuilder(
|
|
column: $table.gainDb,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get cloudId => $composableBuilder(
|
|
column: $table.cloudId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> playlistSongsRefs(
|
|
Expression<bool> Function($$PlaylistSongsTableFilterComposer f) f,
|
|
) {
|
|
final $$PlaylistSongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playlistSongs,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistSongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.playlistSongs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> favoritesRefs(
|
|
Expression<bool> Function($$FavoritesTableFilterComposer f) f,
|
|
) {
|
|
final $$FavoritesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.favorites,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$FavoritesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.favorites,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> playbackHistoryRefs(
|
|
Expression<bool> Function($$PlaybackHistoryTableFilterComposer f) f,
|
|
) {
|
|
final $$PlaybackHistoryTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playbackHistory,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaybackHistoryTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.playbackHistory,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<bool> songCategoriesRefs(
|
|
Expression<bool> Function($$SongCategoriesTableFilterComposer f) f,
|
|
) {
|
|
final $$SongCategoriesTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.songCategories,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongCategoriesTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.songCategories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$SongsTableOrderingComposer extends Composer<_$MeloDb, $SongsTable> {
|
|
$$SongsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get path => $composableBuilder(
|
|
column: $table.path,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get title => $composableBuilder(
|
|
column: $table.title,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get artist => $composableBuilder(
|
|
column: $table.artist,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get album => $composableBuilder(
|
|
column: $table.album,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get coverPath => $composableBuilder(
|
|
column: $table.coverPath,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get dateAddedMs => $composableBuilder(
|
|
column: $table.dateAddedMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get playCount => $composableBuilder(
|
|
column: $table.playCount,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get categoriesEdited => $composableBuilder(
|
|
column: $table.categoriesEdited,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get metadataEdited => $composableBuilder(
|
|
column: $table.metadataEdited,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get lyrics => $composableBuilder(
|
|
column: $table.lyrics,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<double> get gainDb => $composableBuilder(
|
|
column: $table.gainDb,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get cloudId => $composableBuilder(
|
|
column: $table.cloudId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$SongsTableAnnotationComposer extends Composer<_$MeloDb, $SongsTable> {
|
|
$$SongsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get path =>
|
|
$composableBuilder(column: $table.path, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get title =>
|
|
$composableBuilder(column: $table.title, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get artist =>
|
|
$composableBuilder(column: $table.artist, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get album =>
|
|
$composableBuilder(column: $table.album, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get durationMs => $composableBuilder(
|
|
column: $table.durationMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get coverPath =>
|
|
$composableBuilder(column: $table.coverPath, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get dateAddedMs => $composableBuilder(
|
|
column: $table.dateAddedMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get deleted =>
|
|
$composableBuilder(column: $table.deleted, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get playCount =>
|
|
$composableBuilder(column: $table.playCount, builder: (column) => column);
|
|
|
|
GeneratedColumn<bool> get categoriesEdited => $composableBuilder(
|
|
column: $table.categoriesEdited,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get metadataEdited => $composableBuilder(
|
|
column: $table.metadataEdited,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get lyrics =>
|
|
$composableBuilder(column: $table.lyrics, builder: (column) => column);
|
|
|
|
GeneratedColumn<double> get gainDb =>
|
|
$composableBuilder(column: $table.gainDb, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get cloudId =>
|
|
$composableBuilder(column: $table.cloudId, builder: (column) => column);
|
|
|
|
Expression<T> playlistSongsRefs<T extends Object>(
|
|
Expression<T> Function($$PlaylistSongsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$PlaylistSongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playlistSongs,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistSongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.playlistSongs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> favoritesRefs<T extends Object>(
|
|
Expression<T> Function($$FavoritesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$FavoritesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.favorites,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$FavoritesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.favorites,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> playbackHistoryRefs<T extends Object>(
|
|
Expression<T> Function($$PlaybackHistoryTableAnnotationComposer a) f,
|
|
) {
|
|
final $$PlaybackHistoryTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playbackHistory,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaybackHistoryTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.playbackHistory,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
|
|
Expression<T> songCategoriesRefs<T extends Object>(
|
|
Expression<T> Function($$SongCategoriesTableAnnotationComposer a) f,
|
|
) {
|
|
final $$SongCategoriesTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.songCategories,
|
|
getReferencedColumn: (t) => t.songId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongCategoriesTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.songCategories,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$SongsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$SongsTable,
|
|
Song,
|
|
$$SongsTableFilterComposer,
|
|
$$SongsTableOrderingComposer,
|
|
$$SongsTableAnnotationComposer,
|
|
$$SongsTableCreateCompanionBuilder,
|
|
$$SongsTableUpdateCompanionBuilder,
|
|
(Song, $$SongsTableReferences),
|
|
Song,
|
|
PrefetchHooks Function({
|
|
bool playlistSongsRefs,
|
|
bool favoritesRefs,
|
|
bool playbackHistoryRefs,
|
|
bool songCategoriesRefs,
|
|
})
|
|
> {
|
|
$$SongsTableTableManager(_$MeloDb db, $SongsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$SongsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$SongsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$SongsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> path = const Value.absent(),
|
|
Value<String> title = const Value.absent(),
|
|
Value<String?> artist = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> coverPath = const Value.absent(),
|
|
Value<int> dateAddedMs = const Value.absent(),
|
|
Value<int> updatedAtMs = const Value.absent(),
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> playCount = const Value.absent(),
|
|
Value<bool> categoriesEdited = const Value.absent(),
|
|
Value<bool> metadataEdited = const Value.absent(),
|
|
Value<String?> lyrics = const Value.absent(),
|
|
Value<double?> gainDb = const Value.absent(),
|
|
Value<String?> cloudId = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SongsCompanion(
|
|
id: id,
|
|
path: path,
|
|
title: title,
|
|
artist: artist,
|
|
album: album,
|
|
durationMs: durationMs,
|
|
coverPath: coverPath,
|
|
dateAddedMs: dateAddedMs,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
playCount: playCount,
|
|
categoriesEdited: categoriesEdited,
|
|
metadataEdited: metadataEdited,
|
|
lyrics: lyrics,
|
|
gainDb: gainDb,
|
|
cloudId: cloudId,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String path,
|
|
required String title,
|
|
Value<String?> artist = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
Value<int?> durationMs = const Value.absent(),
|
|
Value<String?> coverPath = const Value.absent(),
|
|
required int dateAddedMs,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> playCount = const Value.absent(),
|
|
Value<bool> categoriesEdited = const Value.absent(),
|
|
Value<bool> metadataEdited = const Value.absent(),
|
|
Value<String?> lyrics = const Value.absent(),
|
|
Value<double?> gainDb = const Value.absent(),
|
|
Value<String?> cloudId = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SongsCompanion.insert(
|
|
id: id,
|
|
path: path,
|
|
title: title,
|
|
artist: artist,
|
|
album: album,
|
|
durationMs: durationMs,
|
|
coverPath: coverPath,
|
|
dateAddedMs: dateAddedMs,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
playCount: playCount,
|
|
categoriesEdited: categoriesEdited,
|
|
metadataEdited: metadataEdited,
|
|
lyrics: lyrics,
|
|
gainDb: gainDb,
|
|
cloudId: cloudId,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) =>
|
|
(e.readTable(table), $$SongsTableReferences(db, table, e)),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback:
|
|
({
|
|
playlistSongsRefs = false,
|
|
favoritesRefs = false,
|
|
playbackHistoryRefs = false,
|
|
songCategoriesRefs = false,
|
|
}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (playlistSongsRefs) db.playlistSongs,
|
|
if (favoritesRefs) db.favorites,
|
|
if (playbackHistoryRefs) db.playbackHistory,
|
|
if (songCategoriesRefs) db.songCategories,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (playlistSongsRefs)
|
|
await $_getPrefetchedData<
|
|
Song,
|
|
$SongsTable,
|
|
PlaylistSong
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$SongsTableReferences
|
|
._playlistSongsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$SongsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).playlistSongsRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.songId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (favoritesRefs)
|
|
await $_getPrefetchedData<Song, $SongsTable, Favorite>(
|
|
currentTable: table,
|
|
referencedTable: $$SongsTableReferences
|
|
._favoritesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$SongsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).favoritesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.songId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (playbackHistoryRefs)
|
|
await $_getPrefetchedData<
|
|
Song,
|
|
$SongsTable,
|
|
PlaybackHistoryData
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$SongsTableReferences
|
|
._playbackHistoryRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$SongsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).playbackHistoryRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.songId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
if (songCategoriesRefs)
|
|
await $_getPrefetchedData<
|
|
Song,
|
|
$SongsTable,
|
|
SongCategory
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$SongsTableReferences
|
|
._songCategoriesRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$SongsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).songCategoriesRefs,
|
|
referencedItemsForCurrentItem:
|
|
(item, referencedItems) => referencedItems.where(
|
|
(e) => e.songId == item.id,
|
|
),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$SongsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$SongsTable,
|
|
Song,
|
|
$$SongsTableFilterComposer,
|
|
$$SongsTableOrderingComposer,
|
|
$$SongsTableAnnotationComposer,
|
|
$$SongsTableCreateCompanionBuilder,
|
|
$$SongsTableUpdateCompanionBuilder,
|
|
(Song, $$SongsTableReferences),
|
|
Song,
|
|
PrefetchHooks Function({
|
|
bool playlistSongsRefs,
|
|
bool favoritesRefs,
|
|
bool playbackHistoryRefs,
|
|
bool songCategoriesRefs,
|
|
})
|
|
>;
|
|
typedef $$FoldersTableCreateCompanionBuilder =
|
|
FoldersCompanion Function({
|
|
required String id,
|
|
required String path,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$FoldersTableUpdateCompanionBuilder =
|
|
FoldersCompanion Function({
|
|
Value<String> id,
|
|
Value<String> path,
|
|
Value<int> updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$FoldersTableFilterComposer extends Composer<_$MeloDb, $FoldersTable> {
|
|
$$FoldersTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get path => $composableBuilder(
|
|
column: $table.path,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$FoldersTableOrderingComposer extends Composer<_$MeloDb, $FoldersTable> {
|
|
$$FoldersTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get path => $composableBuilder(
|
|
column: $table.path,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$FoldersTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $FoldersTable> {
|
|
$$FoldersTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get path =>
|
|
$composableBuilder(column: $table.path, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get deleted =>
|
|
$composableBuilder(column: $table.deleted, builder: (column) => column);
|
|
}
|
|
|
|
class $$FoldersTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$FoldersTable,
|
|
Folder,
|
|
$$FoldersTableFilterComposer,
|
|
$$FoldersTableOrderingComposer,
|
|
$$FoldersTableAnnotationComposer,
|
|
$$FoldersTableCreateCompanionBuilder,
|
|
$$FoldersTableUpdateCompanionBuilder,
|
|
(Folder, BaseReferences<_$MeloDb, $FoldersTable, Folder>),
|
|
Folder,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$FoldersTableTableManager(_$MeloDb db, $FoldersTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$FoldersTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$FoldersTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$FoldersTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> path = const Value.absent(),
|
|
Value<int> updatedAtMs = const Value.absent(),
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FoldersCompanion(
|
|
id: id,
|
|
path: path,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String path,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FoldersCompanion.insert(
|
|
id: id,
|
|
path: path,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$FoldersTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$FoldersTable,
|
|
Folder,
|
|
$$FoldersTableFilterComposer,
|
|
$$FoldersTableOrderingComposer,
|
|
$$FoldersTableAnnotationComposer,
|
|
$$FoldersTableCreateCompanionBuilder,
|
|
$$FoldersTableUpdateCompanionBuilder,
|
|
(Folder, BaseReferences<_$MeloDb, $FoldersTable, Folder>),
|
|
Folder,
|
|
PrefetchHooks Function()
|
|
>;
|
|
typedef $$PlaylistsTableCreateCompanionBuilder =
|
|
PlaylistsCompanion Function({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> description,
|
|
required int createdAtMs,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PlaylistsTableUpdateCompanionBuilder =
|
|
PlaylistsCompanion Function({
|
|
Value<String> id,
|
|
Value<String> name,
|
|
Value<String?> description,
|
|
Value<int> createdAtMs,
|
|
Value<int> updatedAtMs,
|
|
Value<bool> deleted,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$PlaylistsTableReferences
|
|
extends BaseReferences<_$MeloDb, $PlaylistsTable, Playlist> {
|
|
$$PlaylistsTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static MultiTypedResultKey<$PlaylistSongsTable, List<PlaylistSong>>
|
|
_playlistSongsRefsTable(_$MeloDb db) => MultiTypedResultKey.fromTable(
|
|
db.playlistSongs,
|
|
aliasName: 'playlists__id__playlist_songs__playlist_id',
|
|
);
|
|
|
|
$$PlaylistSongsTableProcessedTableManager get playlistSongsRefs {
|
|
final manager = $$PlaylistSongsTableTableManager(
|
|
$_db,
|
|
$_db.playlistSongs,
|
|
).filter((f) => f.playlistId.id.sqlEquals($_itemColumn<String>('id')!));
|
|
|
|
final cache = $_typedResult.readTableOrNull(_playlistSongsRefsTable($_db));
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: cache),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$PlaylistsTableFilterComposer
|
|
extends Composer<_$MeloDb, $PlaylistsTable> {
|
|
$$PlaylistsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
Expression<bool> playlistSongsRefs(
|
|
Expression<bool> Function($$PlaylistSongsTableFilterComposer f) f,
|
|
) {
|
|
final $$PlaylistSongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playlistSongs,
|
|
getReferencedColumn: (t) => t.playlistId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistSongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.playlistSongs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$PlaylistsTableOrderingComposer
|
|
extends Composer<_$MeloDb, $PlaylistsTable> {
|
|
$$PlaylistsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get id => $composableBuilder(
|
|
column: $table.id,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<bool> get deleted => $composableBuilder(
|
|
column: $table.deleted,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$PlaylistsTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $PlaylistsTable> {
|
|
$$PlaylistsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get id =>
|
|
$composableBuilder(column: $table.id, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get description => $composableBuilder(
|
|
column: $table.description,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get updatedAtMs => $composableBuilder(
|
|
column: $table.updatedAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<bool> get deleted =>
|
|
$composableBuilder(column: $table.deleted, builder: (column) => column);
|
|
|
|
Expression<T> playlistSongsRefs<T extends Object>(
|
|
Expression<T> Function($$PlaylistSongsTableAnnotationComposer a) f,
|
|
) {
|
|
final $$PlaylistSongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.id,
|
|
referencedTable: $db.playlistSongs,
|
|
getReferencedColumn: (t) => t.playlistId,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistSongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.playlistSongs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return f(composer);
|
|
}
|
|
}
|
|
|
|
class $$PlaylistsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$PlaylistsTable,
|
|
Playlist,
|
|
$$PlaylistsTableFilterComposer,
|
|
$$PlaylistsTableOrderingComposer,
|
|
$$PlaylistsTableAnnotationComposer,
|
|
$$PlaylistsTableCreateCompanionBuilder,
|
|
$$PlaylistsTableUpdateCompanionBuilder,
|
|
(Playlist, $$PlaylistsTableReferences),
|
|
Playlist,
|
|
PrefetchHooks Function({bool playlistSongsRefs})
|
|
> {
|
|
$$PlaylistsTableTableManager(_$MeloDb db, $PlaylistsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PlaylistsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PlaylistsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PlaylistsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> id = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<String?> description = const Value.absent(),
|
|
Value<int> createdAtMs = const Value.absent(),
|
|
Value<int> updatedAtMs = const Value.absent(),
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaylistsCompanion(
|
|
id: id,
|
|
name: name,
|
|
description: description,
|
|
createdAtMs: createdAtMs,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String id,
|
|
required String name,
|
|
Value<String?> description = const Value.absent(),
|
|
required int createdAtMs,
|
|
required int updatedAtMs,
|
|
Value<bool> deleted = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaylistsCompanion.insert(
|
|
id: id,
|
|
name: name,
|
|
description: description,
|
|
createdAtMs: createdAtMs,
|
|
updatedAtMs: updatedAtMs,
|
|
deleted: deleted,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$PlaylistsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({playlistSongsRefs = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [
|
|
if (playlistSongsRefs) db.playlistSongs,
|
|
],
|
|
addJoins: null,
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [
|
|
if (playlistSongsRefs)
|
|
await $_getPrefetchedData<
|
|
Playlist,
|
|
$PlaylistsTable,
|
|
PlaylistSong
|
|
>(
|
|
currentTable: table,
|
|
referencedTable: $$PlaylistsTableReferences
|
|
._playlistSongsRefsTable(db),
|
|
managerFromTypedResult: (p0) =>
|
|
$$PlaylistsTableReferences(
|
|
db,
|
|
table,
|
|
p0,
|
|
).playlistSongsRefs,
|
|
referencedItemsForCurrentItem: (item, referencedItems) =>
|
|
referencedItems.where((e) => e.playlistId == item.id),
|
|
typedResults: items,
|
|
),
|
|
];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PlaylistsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$PlaylistsTable,
|
|
Playlist,
|
|
$$PlaylistsTableFilterComposer,
|
|
$$PlaylistsTableOrderingComposer,
|
|
$$PlaylistsTableAnnotationComposer,
|
|
$$PlaylistsTableCreateCompanionBuilder,
|
|
$$PlaylistsTableUpdateCompanionBuilder,
|
|
(Playlist, $$PlaylistsTableReferences),
|
|
Playlist,
|
|
PrefetchHooks Function({bool playlistSongsRefs})
|
|
>;
|
|
typedef $$PlaylistSongsTableCreateCompanionBuilder =
|
|
PlaylistSongsCompanion Function({
|
|
required String playlistId,
|
|
required String songId,
|
|
required int position,
|
|
required int addedAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PlaylistSongsTableUpdateCompanionBuilder =
|
|
PlaylistSongsCompanion Function({
|
|
Value<String> playlistId,
|
|
Value<String> songId,
|
|
Value<int> position,
|
|
Value<int> addedAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$PlaylistSongsTableReferences
|
|
extends BaseReferences<_$MeloDb, $PlaylistSongsTable, PlaylistSong> {
|
|
$$PlaylistSongsTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $PlaylistsTable _playlistIdTable(_$MeloDb db) =>
|
|
db.playlists.createAlias('playlist_songs__playlist_id__playlists__id');
|
|
|
|
$$PlaylistsTableProcessedTableManager get playlistId {
|
|
final $_column = $_itemColumn<String>('playlist_id')!;
|
|
|
|
final manager = $$PlaylistsTableTableManager(
|
|
$_db,
|
|
$_db.playlists,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_playlistIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
|
|
static $SongsTable _songIdTable(_$MeloDb db) =>
|
|
db.songs.createAlias('playlist_songs__song_id__songs__id');
|
|
|
|
$$SongsTableProcessedTableManager get songId {
|
|
final $_column = $_itemColumn<String>('song_id')!;
|
|
|
|
final manager = $$SongsTableTableManager(
|
|
$_db,
|
|
$_db.songs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_songIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$PlaylistSongsTableFilterComposer
|
|
extends Composer<_$MeloDb, $PlaylistSongsTable> {
|
|
$$PlaylistSongsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get addedAtMs => $composableBuilder(
|
|
column: $table.addedAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$PlaylistsTableFilterComposer get playlistId {
|
|
final $$PlaylistsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.playlistId,
|
|
referencedTable: $db.playlists,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.playlists,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$SongsTableFilterComposer get songId {
|
|
final $$SongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaylistSongsTableOrderingComposer
|
|
extends Composer<_$MeloDb, $PlaylistSongsTable> {
|
|
$$PlaylistSongsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get addedAtMs => $composableBuilder(
|
|
column: $table.addedAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$PlaylistsTableOrderingComposer get playlistId {
|
|
final $$PlaylistsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.playlistId,
|
|
referencedTable: $db.playlists,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.playlists,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$SongsTableOrderingComposer get songId {
|
|
final $$SongsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaylistSongsTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $PlaylistSongsTable> {
|
|
$$PlaylistSongsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get position =>
|
|
$composableBuilder(column: $table.position, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get addedAtMs =>
|
|
$composableBuilder(column: $table.addedAtMs, builder: (column) => column);
|
|
|
|
$$PlaylistsTableAnnotationComposer get playlistId {
|
|
final $$PlaylistsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.playlistId,
|
|
referencedTable: $db.playlists,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$PlaylistsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.playlists,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
|
|
$$SongsTableAnnotationComposer get songId {
|
|
final $$SongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaylistSongsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$PlaylistSongsTable,
|
|
PlaylistSong,
|
|
$$PlaylistSongsTableFilterComposer,
|
|
$$PlaylistSongsTableOrderingComposer,
|
|
$$PlaylistSongsTableAnnotationComposer,
|
|
$$PlaylistSongsTableCreateCompanionBuilder,
|
|
$$PlaylistSongsTableUpdateCompanionBuilder,
|
|
(PlaylistSong, $$PlaylistSongsTableReferences),
|
|
PlaylistSong,
|
|
PrefetchHooks Function({bool playlistId, bool songId})
|
|
> {
|
|
$$PlaylistSongsTableTableManager(_$MeloDb db, $PlaylistSongsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PlaylistSongsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PlaylistSongsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PlaylistSongsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> playlistId = const Value.absent(),
|
|
Value<String> songId = const Value.absent(),
|
|
Value<int> position = const Value.absent(),
|
|
Value<int> addedAtMs = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaylistSongsCompanion(
|
|
playlistId: playlistId,
|
|
songId: songId,
|
|
position: position,
|
|
addedAtMs: addedAtMs,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String playlistId,
|
|
required String songId,
|
|
required int position,
|
|
required int addedAtMs,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaylistSongsCompanion.insert(
|
|
playlistId: playlistId,
|
|
songId: songId,
|
|
position: position,
|
|
addedAtMs: addedAtMs,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$PlaylistSongsTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({playlistId = false, songId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (playlistId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.playlistId,
|
|
referencedTable: $$PlaylistSongsTableReferences
|
|
._playlistIdTable(db),
|
|
referencedColumn: $$PlaylistSongsTableReferences
|
|
._playlistIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
if (songId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.songId,
|
|
referencedTable: $$PlaylistSongsTableReferences
|
|
._songIdTable(db),
|
|
referencedColumn: $$PlaylistSongsTableReferences
|
|
._songIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PlaylistSongsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$PlaylistSongsTable,
|
|
PlaylistSong,
|
|
$$PlaylistSongsTableFilterComposer,
|
|
$$PlaylistSongsTableOrderingComposer,
|
|
$$PlaylistSongsTableAnnotationComposer,
|
|
$$PlaylistSongsTableCreateCompanionBuilder,
|
|
$$PlaylistSongsTableUpdateCompanionBuilder,
|
|
(PlaylistSong, $$PlaylistSongsTableReferences),
|
|
PlaylistSong,
|
|
PrefetchHooks Function({bool playlistId, bool songId})
|
|
>;
|
|
typedef $$FavoritesTableCreateCompanionBuilder =
|
|
FavoritesCompanion Function({
|
|
required String songId,
|
|
required int createdAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$FavoritesTableUpdateCompanionBuilder =
|
|
FavoritesCompanion Function({
|
|
Value<String> songId,
|
|
Value<int> createdAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$FavoritesTableReferences
|
|
extends BaseReferences<_$MeloDb, $FavoritesTable, Favorite> {
|
|
$$FavoritesTableReferences(super.$_db, super.$_table, super.$_typedResult);
|
|
|
|
static $SongsTable _songIdTable(_$MeloDb db) =>
|
|
db.songs.createAlias('favorites__song_id__songs__id');
|
|
|
|
$$SongsTableProcessedTableManager get songId {
|
|
final $_column = $_itemColumn<String>('song_id')!;
|
|
|
|
final manager = $$SongsTableTableManager(
|
|
$_db,
|
|
$_db.songs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_songIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$FavoritesTableFilterComposer
|
|
extends Composer<_$MeloDb, $FavoritesTable> {
|
|
$$FavoritesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$SongsTableFilterComposer get songId {
|
|
final $$SongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$FavoritesTableOrderingComposer
|
|
extends Composer<_$MeloDb, $FavoritesTable> {
|
|
$$FavoritesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$SongsTableOrderingComposer get songId {
|
|
final $$SongsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$FavoritesTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $FavoritesTable> {
|
|
$$FavoritesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get createdAtMs => $composableBuilder(
|
|
column: $table.createdAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$SongsTableAnnotationComposer get songId {
|
|
final $$SongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$FavoritesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$FavoritesTable,
|
|
Favorite,
|
|
$$FavoritesTableFilterComposer,
|
|
$$FavoritesTableOrderingComposer,
|
|
$$FavoritesTableAnnotationComposer,
|
|
$$FavoritesTableCreateCompanionBuilder,
|
|
$$FavoritesTableUpdateCompanionBuilder,
|
|
(Favorite, $$FavoritesTableReferences),
|
|
Favorite,
|
|
PrefetchHooks Function({bool songId})
|
|
> {
|
|
$$FavoritesTableTableManager(_$MeloDb db, $FavoritesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$FavoritesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$FavoritesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$FavoritesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> songId = const Value.absent(),
|
|
Value<int> createdAtMs = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FavoritesCompanion(
|
|
songId: songId,
|
|
createdAtMs: createdAtMs,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String songId,
|
|
required int createdAtMs,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => FavoritesCompanion.insert(
|
|
songId: songId,
|
|
createdAtMs: createdAtMs,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$FavoritesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({songId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (songId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.songId,
|
|
referencedTable: $$FavoritesTableReferences
|
|
._songIdTable(db),
|
|
referencedColumn: $$FavoritesTableReferences
|
|
._songIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$FavoritesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$FavoritesTable,
|
|
Favorite,
|
|
$$FavoritesTableFilterComposer,
|
|
$$FavoritesTableOrderingComposer,
|
|
$$FavoritesTableAnnotationComposer,
|
|
$$FavoritesTableCreateCompanionBuilder,
|
|
$$FavoritesTableUpdateCompanionBuilder,
|
|
(Favorite, $$FavoritesTableReferences),
|
|
Favorite,
|
|
PrefetchHooks Function({bool songId})
|
|
>;
|
|
typedef $$PlaybackHistoryTableCreateCompanionBuilder =
|
|
PlaybackHistoryCompanion Function({
|
|
required String songId,
|
|
required int positionMs,
|
|
required int playedAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$PlaybackHistoryTableUpdateCompanionBuilder =
|
|
PlaybackHistoryCompanion Function({
|
|
Value<String> songId,
|
|
Value<int> positionMs,
|
|
Value<int> playedAtMs,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$PlaybackHistoryTableReferences
|
|
extends
|
|
BaseReferences<_$MeloDb, $PlaybackHistoryTable, PlaybackHistoryData> {
|
|
$$PlaybackHistoryTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $SongsTable _songIdTable(_$MeloDb db) =>
|
|
db.songs.createAlias('playback_history__song_id__songs__id');
|
|
|
|
$$SongsTableProcessedTableManager get songId {
|
|
final $_column = $_itemColumn<String>('song_id')!;
|
|
|
|
final manager = $$SongsTableTableManager(
|
|
$_db,
|
|
$_db.songs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_songIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$PlaybackHistoryTableFilterComposer
|
|
extends Composer<_$MeloDb, $PlaybackHistoryTable> {
|
|
$$PlaybackHistoryTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<int> get positionMs => $composableBuilder(
|
|
column: $table.positionMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get playedAtMs => $composableBuilder(
|
|
column: $table.playedAtMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$SongsTableFilterComposer get songId {
|
|
final $$SongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaybackHistoryTableOrderingComposer
|
|
extends Composer<_$MeloDb, $PlaybackHistoryTable> {
|
|
$$PlaybackHistoryTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<int> get positionMs => $composableBuilder(
|
|
column: $table.positionMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get playedAtMs => $composableBuilder(
|
|
column: $table.playedAtMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$SongsTableOrderingComposer get songId {
|
|
final $$SongsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaybackHistoryTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $PlaybackHistoryTable> {
|
|
$$PlaybackHistoryTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<int> get positionMs => $composableBuilder(
|
|
column: $table.positionMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get playedAtMs => $composableBuilder(
|
|
column: $table.playedAtMs,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
$$SongsTableAnnotationComposer get songId {
|
|
final $$SongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$PlaybackHistoryTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$PlaybackHistoryTable,
|
|
PlaybackHistoryData,
|
|
$$PlaybackHistoryTableFilterComposer,
|
|
$$PlaybackHistoryTableOrderingComposer,
|
|
$$PlaybackHistoryTableAnnotationComposer,
|
|
$$PlaybackHistoryTableCreateCompanionBuilder,
|
|
$$PlaybackHistoryTableUpdateCompanionBuilder,
|
|
(PlaybackHistoryData, $$PlaybackHistoryTableReferences),
|
|
PlaybackHistoryData,
|
|
PrefetchHooks Function({bool songId})
|
|
> {
|
|
$$PlaybackHistoryTableTableManager(_$MeloDb db, $PlaybackHistoryTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$PlaybackHistoryTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$PlaybackHistoryTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$PlaybackHistoryTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> songId = const Value.absent(),
|
|
Value<int> positionMs = const Value.absent(),
|
|
Value<int> playedAtMs = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaybackHistoryCompanion(
|
|
songId: songId,
|
|
positionMs: positionMs,
|
|
playedAtMs: playedAtMs,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String songId,
|
|
required int positionMs,
|
|
required int playedAtMs,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => PlaybackHistoryCompanion.insert(
|
|
songId: songId,
|
|
positionMs: positionMs,
|
|
playedAtMs: playedAtMs,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$PlaybackHistoryTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({songId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (songId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.songId,
|
|
referencedTable:
|
|
$$PlaybackHistoryTableReferences
|
|
._songIdTable(db),
|
|
referencedColumn:
|
|
$$PlaybackHistoryTableReferences
|
|
._songIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$PlaybackHistoryTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$PlaybackHistoryTable,
|
|
PlaybackHistoryData,
|
|
$$PlaybackHistoryTableFilterComposer,
|
|
$$PlaybackHistoryTableOrderingComposer,
|
|
$$PlaybackHistoryTableAnnotationComposer,
|
|
$$PlaybackHistoryTableCreateCompanionBuilder,
|
|
$$PlaybackHistoryTableUpdateCompanionBuilder,
|
|
(PlaybackHistoryData, $$PlaybackHistoryTableReferences),
|
|
PlaybackHistoryData,
|
|
PrefetchHooks Function({bool songId})
|
|
>;
|
|
typedef $$SongCategoriesTableCreateCompanionBuilder =
|
|
SongCategoriesCompanion Function({
|
|
required String songId,
|
|
required String name,
|
|
required int position,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$SongCategoriesTableUpdateCompanionBuilder =
|
|
SongCategoriesCompanion Function({
|
|
Value<String> songId,
|
|
Value<String> name,
|
|
Value<int> position,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
final class $$SongCategoriesTableReferences
|
|
extends BaseReferences<_$MeloDb, $SongCategoriesTable, SongCategory> {
|
|
$$SongCategoriesTableReferences(
|
|
super.$_db,
|
|
super.$_table,
|
|
super.$_typedResult,
|
|
);
|
|
|
|
static $SongsTable _songIdTable(_$MeloDb db) =>
|
|
db.songs.createAlias('song_categories__song_id__songs__id');
|
|
|
|
$$SongsTableProcessedTableManager get songId {
|
|
final $_column = $_itemColumn<String>('song_id')!;
|
|
|
|
final manager = $$SongsTableTableManager(
|
|
$_db,
|
|
$_db.songs,
|
|
).filter((f) => f.id.sqlEquals($_column));
|
|
final item = $_typedResult.readTableOrNull(_songIdTable($_db));
|
|
if (item == null) return manager;
|
|
return ProcessedTableManager(
|
|
manager.$state.copyWith(prefetchedData: [item]),
|
|
);
|
|
}
|
|
}
|
|
|
|
class $$SongCategoriesTableFilterComposer
|
|
extends Composer<_$MeloDb, $SongCategoriesTable> {
|
|
$$SongCategoriesTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
$$SongsTableFilterComposer get songId {
|
|
final $$SongsTableFilterComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableFilterComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$SongCategoriesTableOrderingComposer
|
|
extends Composer<_$MeloDb, $SongCategoriesTable> {
|
|
$$SongCategoriesTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get name => $composableBuilder(
|
|
column: $table.name,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get position => $composableBuilder(
|
|
column: $table.position,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
$$SongsTableOrderingComposer get songId {
|
|
final $$SongsTableOrderingComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableOrderingComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$SongCategoriesTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $SongCategoriesTable> {
|
|
$$SongCategoriesTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get name =>
|
|
$composableBuilder(column: $table.name, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get position =>
|
|
$composableBuilder(column: $table.position, builder: (column) => column);
|
|
|
|
$$SongsTableAnnotationComposer get songId {
|
|
final $$SongsTableAnnotationComposer composer = $composerBuilder(
|
|
composer: this,
|
|
getCurrentColumn: (t) => t.songId,
|
|
referencedTable: $db.songs,
|
|
getReferencedColumn: (t) => t.id,
|
|
builder:
|
|
(
|
|
joinBuilder, {
|
|
$addJoinBuilderToRootComposer,
|
|
$removeJoinBuilderFromRootComposer,
|
|
}) => $$SongsTableAnnotationComposer(
|
|
$db: $db,
|
|
$table: $db.songs,
|
|
$addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer,
|
|
joinBuilder: joinBuilder,
|
|
$removeJoinBuilderFromRootComposer:
|
|
$removeJoinBuilderFromRootComposer,
|
|
),
|
|
);
|
|
return composer;
|
|
}
|
|
}
|
|
|
|
class $$SongCategoriesTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$SongCategoriesTable,
|
|
SongCategory,
|
|
$$SongCategoriesTableFilterComposer,
|
|
$$SongCategoriesTableOrderingComposer,
|
|
$$SongCategoriesTableAnnotationComposer,
|
|
$$SongCategoriesTableCreateCompanionBuilder,
|
|
$$SongCategoriesTableUpdateCompanionBuilder,
|
|
(SongCategory, $$SongCategoriesTableReferences),
|
|
SongCategory,
|
|
PrefetchHooks Function({bool songId})
|
|
> {
|
|
$$SongCategoriesTableTableManager(_$MeloDb db, $SongCategoriesTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$SongCategoriesTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$SongCategoriesTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$SongCategoriesTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> songId = const Value.absent(),
|
|
Value<String> name = const Value.absent(),
|
|
Value<int> position = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SongCategoriesCompanion(
|
|
songId: songId,
|
|
name: name,
|
|
position: position,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String songId,
|
|
required String name,
|
|
required int position,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => SongCategoriesCompanion.insert(
|
|
songId: songId,
|
|
name: name,
|
|
position: position,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map(
|
|
(e) => (
|
|
e.readTable(table),
|
|
$$SongCategoriesTableReferences(db, table, e),
|
|
),
|
|
)
|
|
.toList(),
|
|
prefetchHooksCallback: ({songId = false}) {
|
|
return PrefetchHooks(
|
|
db: db,
|
|
explicitlyWatchedTables: [],
|
|
addJoins:
|
|
<
|
|
T extends TableManagerState<
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic,
|
|
dynamic
|
|
>
|
|
>(state) {
|
|
if (songId) {
|
|
state =
|
|
state.withJoin(
|
|
currentTable: table,
|
|
currentColumn: table.songId,
|
|
referencedTable: $$SongCategoriesTableReferences
|
|
._songIdTable(db),
|
|
referencedColumn:
|
|
$$SongCategoriesTableReferences
|
|
._songIdTable(db)
|
|
.id,
|
|
)
|
|
as T;
|
|
}
|
|
|
|
return state;
|
|
},
|
|
getPrefetchedDataCallback: (items) async {
|
|
return [];
|
|
},
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$SongCategoriesTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$SongCategoriesTable,
|
|
SongCategory,
|
|
$$SongCategoriesTableFilterComposer,
|
|
$$SongCategoriesTableOrderingComposer,
|
|
$$SongCategoriesTableAnnotationComposer,
|
|
$$SongCategoriesTableCreateCompanionBuilder,
|
|
$$SongCategoriesTableUpdateCompanionBuilder,
|
|
(SongCategory, $$SongCategoriesTableReferences),
|
|
SongCategory,
|
|
PrefetchHooks Function({bool songId})
|
|
>;
|
|
typedef $$DownloadsTableCreateCompanionBuilder =
|
|
DownloadsCompanion Function({
|
|
required String navidromeId,
|
|
required String titel,
|
|
Value<String?> kuenstler,
|
|
Value<String?> album,
|
|
required int groesseBytes,
|
|
required int geladenAmMs,
|
|
Value<int> rowid,
|
|
});
|
|
typedef $$DownloadsTableUpdateCompanionBuilder =
|
|
DownloadsCompanion Function({
|
|
Value<String> navidromeId,
|
|
Value<String> titel,
|
|
Value<String?> kuenstler,
|
|
Value<String?> album,
|
|
Value<int> groesseBytes,
|
|
Value<int> geladenAmMs,
|
|
Value<int> rowid,
|
|
});
|
|
|
|
class $$DownloadsTableFilterComposer
|
|
extends Composer<_$MeloDb, $DownloadsTable> {
|
|
$$DownloadsTableFilterComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnFilters<String> get navidromeId => $composableBuilder(
|
|
column: $table.navidromeId,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get titel => $composableBuilder(
|
|
column: $table.titel,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get kuenstler => $composableBuilder(
|
|
column: $table.kuenstler,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<String> get album => $composableBuilder(
|
|
column: $table.album,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get groesseBytes => $composableBuilder(
|
|
column: $table.groesseBytes,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
|
|
ColumnFilters<int> get geladenAmMs => $composableBuilder(
|
|
column: $table.geladenAmMs,
|
|
builder: (column) => ColumnFilters(column),
|
|
);
|
|
}
|
|
|
|
class $$DownloadsTableOrderingComposer
|
|
extends Composer<_$MeloDb, $DownloadsTable> {
|
|
$$DownloadsTableOrderingComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
ColumnOrderings<String> get navidromeId => $composableBuilder(
|
|
column: $table.navidromeId,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get titel => $composableBuilder(
|
|
column: $table.titel,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get kuenstler => $composableBuilder(
|
|
column: $table.kuenstler,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<String> get album => $composableBuilder(
|
|
column: $table.album,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get groesseBytes => $composableBuilder(
|
|
column: $table.groesseBytes,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
|
|
ColumnOrderings<int> get geladenAmMs => $composableBuilder(
|
|
column: $table.geladenAmMs,
|
|
builder: (column) => ColumnOrderings(column),
|
|
);
|
|
}
|
|
|
|
class $$DownloadsTableAnnotationComposer
|
|
extends Composer<_$MeloDb, $DownloadsTable> {
|
|
$$DownloadsTableAnnotationComposer({
|
|
required super.$db,
|
|
required super.$table,
|
|
super.joinBuilder,
|
|
super.$addJoinBuilderToRootComposer,
|
|
super.$removeJoinBuilderFromRootComposer,
|
|
});
|
|
GeneratedColumn<String> get navidromeId => $composableBuilder(
|
|
column: $table.navidromeId,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<String> get titel =>
|
|
$composableBuilder(column: $table.titel, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get kuenstler =>
|
|
$composableBuilder(column: $table.kuenstler, builder: (column) => column);
|
|
|
|
GeneratedColumn<String> get album =>
|
|
$composableBuilder(column: $table.album, builder: (column) => column);
|
|
|
|
GeneratedColumn<int> get groesseBytes => $composableBuilder(
|
|
column: $table.groesseBytes,
|
|
builder: (column) => column,
|
|
);
|
|
|
|
GeneratedColumn<int> get geladenAmMs => $composableBuilder(
|
|
column: $table.geladenAmMs,
|
|
builder: (column) => column,
|
|
);
|
|
}
|
|
|
|
class $$DownloadsTableTableManager
|
|
extends
|
|
RootTableManager<
|
|
_$MeloDb,
|
|
$DownloadsTable,
|
|
Download,
|
|
$$DownloadsTableFilterComposer,
|
|
$$DownloadsTableOrderingComposer,
|
|
$$DownloadsTableAnnotationComposer,
|
|
$$DownloadsTableCreateCompanionBuilder,
|
|
$$DownloadsTableUpdateCompanionBuilder,
|
|
(Download, BaseReferences<_$MeloDb, $DownloadsTable, Download>),
|
|
Download,
|
|
PrefetchHooks Function()
|
|
> {
|
|
$$DownloadsTableTableManager(_$MeloDb db, $DownloadsTable table)
|
|
: super(
|
|
TableManagerState(
|
|
db: db,
|
|
table: table,
|
|
createFilteringComposer: () =>
|
|
$$DownloadsTableFilterComposer($db: db, $table: table),
|
|
createOrderingComposer: () =>
|
|
$$DownloadsTableOrderingComposer($db: db, $table: table),
|
|
createComputedFieldComposer: () =>
|
|
$$DownloadsTableAnnotationComposer($db: db, $table: table),
|
|
updateCompanionCallback:
|
|
({
|
|
Value<String> navidromeId = const Value.absent(),
|
|
Value<String> titel = const Value.absent(),
|
|
Value<String?> kuenstler = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
Value<int> groesseBytes = const Value.absent(),
|
|
Value<int> geladenAmMs = const Value.absent(),
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => DownloadsCompanion(
|
|
navidromeId: navidromeId,
|
|
titel: titel,
|
|
kuenstler: kuenstler,
|
|
album: album,
|
|
groesseBytes: groesseBytes,
|
|
geladenAmMs: geladenAmMs,
|
|
rowid: rowid,
|
|
),
|
|
createCompanionCallback:
|
|
({
|
|
required String navidromeId,
|
|
required String titel,
|
|
Value<String?> kuenstler = const Value.absent(),
|
|
Value<String?> album = const Value.absent(),
|
|
required int groesseBytes,
|
|
required int geladenAmMs,
|
|
Value<int> rowid = const Value.absent(),
|
|
}) => DownloadsCompanion.insert(
|
|
navidromeId: navidromeId,
|
|
titel: titel,
|
|
kuenstler: kuenstler,
|
|
album: album,
|
|
groesseBytes: groesseBytes,
|
|
geladenAmMs: geladenAmMs,
|
|
rowid: rowid,
|
|
),
|
|
withReferenceMapper: (p0) => p0
|
|
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
|
|
.toList(),
|
|
prefetchHooksCallback: null,
|
|
),
|
|
);
|
|
}
|
|
|
|
typedef $$DownloadsTableProcessedTableManager =
|
|
ProcessedTableManager<
|
|
_$MeloDb,
|
|
$DownloadsTable,
|
|
Download,
|
|
$$DownloadsTableFilterComposer,
|
|
$$DownloadsTableOrderingComposer,
|
|
$$DownloadsTableAnnotationComposer,
|
|
$$DownloadsTableCreateCompanionBuilder,
|
|
$$DownloadsTableUpdateCompanionBuilder,
|
|
(Download, BaseReferences<_$MeloDb, $DownloadsTable, Download>),
|
|
Download,
|
|
PrefetchHooks Function()
|
|
>;
|
|
|
|
class $MeloDbManager {
|
|
final _$MeloDb _db;
|
|
$MeloDbManager(this._db);
|
|
$$SongsTableTableManager get songs =>
|
|
$$SongsTableTableManager(_db, _db.songs);
|
|
$$FoldersTableTableManager get folders =>
|
|
$$FoldersTableTableManager(_db, _db.folders);
|
|
$$PlaylistsTableTableManager get playlists =>
|
|
$$PlaylistsTableTableManager(_db, _db.playlists);
|
|
$$PlaylistSongsTableTableManager get playlistSongs =>
|
|
$$PlaylistSongsTableTableManager(_db, _db.playlistSongs);
|
|
$$FavoritesTableTableManager get favorites =>
|
|
$$FavoritesTableTableManager(_db, _db.favorites);
|
|
$$PlaybackHistoryTableTableManager get playbackHistory =>
|
|
$$PlaybackHistoryTableTableManager(_db, _db.playbackHistory);
|
|
$$SongCategoriesTableTableManager get songCategories =>
|
|
$$SongCategoriesTableTableManager(_db, _db.songCategories);
|
|
$$DownloadsTableTableManager get downloads =>
|
|
$$DownloadsTableTableManager(_db, _db.downloads);
|
|
}
|