fix: rust models type_name being consumed earlier and

This commit is contained in:
Kingkor Roy Tirtho 2025-12-12 17:10:47 +06:00
parent 1e1f2ca82c
commit 65701cb07c
51 changed files with 546 additions and 840 deletions

View File

@ -4,14 +4,14 @@ import 'package:spotube/provider/history/summary.dart';
abstract class FakeData {
static const SpotubeImageObject image = SpotubeImageObject(
typeName: "image",
// typeName: "image",
height: 100,
width: 100,
url: "https://dummyimage.com/100x100/cfcfcf/cfcfcf.jpg",
);
static const SpotubeFullArtistObject artist = SpotubeFullArtistObject(
typeName: "artist_full",
// typeName: "artist_full",
id: "1",
name: "What an artist",
externalUri: "https://example.com",
@ -19,7 +19,7 @@ abstract class FakeData {
genres: ["genre"],
images: [
SpotubeImageObject(
typeName: "image",
// typeName: "image",
height: 100,
width: 100,
url: "https://dummyimage.com/100x100/cfcfcf/cfcfcf.jpg",
@ -28,7 +28,7 @@ abstract class FakeData {
);
static const SpotubeFullAlbumObject album = SpotubeFullAlbumObject(
typeName: "album_full",
// typeName: "album_full",
id: "1",
name: "A good album",
externalUri: "https://example.com",
@ -43,7 +43,7 @@ abstract class FakeData {
static const SpotubeSimpleArtistObject artistSimple =
SpotubeSimpleArtistObject(
typeName: "artist_simple",
// typeName: "artist_simple",
id: "1",
name: "What an artist",
externalUri: "https://example.com",
@ -51,7 +51,7 @@ abstract class FakeData {
);
static const SpotubeSimpleAlbumObject albumSimple = SpotubeSimpleAlbumObject(
typeName: "album_simple",
// typeName: "album_simple",
albumType: SpotubeAlbumType.album,
artists: [],
externalUri: "https://example.com",
@ -60,7 +60,7 @@ abstract class FakeData {
releaseDate: "2021-01-01",
images: [
SpotubeImageObject(
typeName: "image",
// typeName: "image",
height: 1,
width: 1,
url: "https://dummyimage.com/100x100/cfcfcf/cfcfcf.jpg",
@ -70,7 +70,7 @@ abstract class FakeData {
static const SpotubeTrackObject track = SpotubeTrackObject.full(
SpotubeFullTrackObject(
typeName: "track",
// typeName: "track",
id: "1",
name: "A good track",
externalUri: "https://example.com",
@ -83,7 +83,7 @@ abstract class FakeData {
);
static const SpotubeUserObject user = SpotubeUserObject(
typeName: "user",
// typeName: "user",
id: "1",
name: "User Name",
externalUri: "https://example.com",
@ -91,7 +91,7 @@ abstract class FakeData {
);
static const SpotubeFullPlaylistObject playlist = SpotubeFullPlaylistObject(
typeName: "playlist_full",
// typeName: "playlist_full",
id: "1",
name: "A good playlist",
description: "A very good playlist description",
@ -104,7 +104,7 @@ abstract class FakeData {
static const SpotubeSimplePlaylistObject playlistSimple =
SpotubeSimplePlaylistObject(
typeName: "playlist_simple",
// typeName: "playlist_simple",
id: "1",
name: "A good playlist",
description: "A very good playlist description",
@ -115,7 +115,7 @@ abstract class FakeData {
static const SpotubeBrowseSectionObject browseSection =
SpotubeBrowseSectionObject(
typeName: "browse_section",
// typeName: "browse_section",
id: "section-id",
title: "Browse Section",
browseMore: true,

View File

@ -50,29 +50,7 @@ extension SpotubePaginationResponseObjectExtension
SpotubeFlattenedPaginationObject<T> flatten<T>() {
return SpotubeFlattenedPaginationObject.from<T>(
this,
(item) => switch (T) {
SpotubeSimpleAlbumObject() =>
(item as SpotubePaginationResponseObjectItem_AlbumSimple).field0 as T,
SpotubeFullAlbumObject() =>
(item as SpotubePaginationResponseObjectItem_AlbumFull).field0 as T,
SpotubeSimpleArtistObject() =>
(item as SpotubePaginationResponseObjectItem_ArtistSimple).field0
as T,
SpotubeFullArtistObject() =>
(item as SpotubePaginationResponseObjectItem_ArtistFull).field0 as T,
SpotubeTrackObject() =>
(item as SpotubePaginationResponseObjectItem_Track).field0 as T,
SpotubeSimplePlaylistObject() =>
(item as SpotubePaginationResponseObjectItem_PlaylistSimple).field0
as T,
SpotubeFullPlaylistObject() =>
(item as SpotubePaginationResponseObjectItem_PlaylistFull).field0
as T,
SpotubeBrowseSectionObject() =>
(item as SpotubePaginationResponseObjectItem_BrowseSection).field0
as T,
_ => throw Exception("Unsupported type: $T"),
},
(item) => item.field0 as T,
);
}
}

View File

@ -98,13 +98,13 @@ SpotubeLocalTrackObject localTrackFromFile(
String? art,
}) {
return SpotubeLocalTrackObject(
typeName: "track_local",
// typeName: "track_local",
id: file.absolute.path,
name: metadata?.title ?? basenameWithoutExtension(file.path),
externalUri: "file://${file.absolute.path}",
artists: metadata?.artist?.split(",").map((a) {
return SpotubeSimpleArtistObject(
typeName: "artist_simple",
// typeName: "artist_simple",
id: a.trim(),
name: a.trim(),
externalUri: "file://${file.absolute.path}",
@ -112,21 +112,21 @@ SpotubeLocalTrackObject localTrackFromFile(
}).toList() ??
[
SpotubeSimpleArtistObject(
typeName: "artist_simple",
// typeName: "artist_simple",
id: "unknown",
name: "Unknown Artist",
externalUri: "file://${file.absolute.path}",
),
],
album: SpotubeSimpleAlbumObject(
typeName: "album_simple",
// typeName: "album_simple",
albumType: SpotubeAlbumType.album,
id: metadata?.album ?? "unknown",
name: metadata?.album ?? "Unknown Album",
externalUri: "file://${file.absolute.path}",
artists: [
SpotubeSimpleArtistObject(
typeName: "artist_simple",
// typeName: "artist_simple",
id: metadata?.albumArtist ?? "unknown",
name: metadata?.albumArtist ?? "Unknown Artist",
externalUri: "file://${file.absolute.path}",
@ -137,7 +137,7 @@ SpotubeLocalTrackObject localTrackFromFile(
images: [
if (art != null)
SpotubeImageObject(
typeName: "image",
// typeName: "image",
url: art,
width: 300,
height: 300,

View File

@ -81,7 +81,7 @@ class HomePageBrowseSection extends HookConsumerWidget {
if (section.items.isEmpty) return const SizedBox.shrink();
return HorizontalPlaybuttonCardView(
items: section.items,
items: section.items.map((e) => e.field0).toList(),
title: Text(section.title),
hasNextPage: false,
isLoadingNextPage: false,

View File

@ -43,7 +43,7 @@ class UserPlaylistsPage extends HookConsumerWidget {
() => me.asData?.value == null
? null
: SpotubeSimplePlaylistObject(
typeName: "playlist_simple",
// typeName: "playlist_simple",
id: "user-liked-tracks",
name: context.l10n.liked_tracks,
description: context.l10n.liked_tracks_description,
@ -51,7 +51,7 @@ class UserPlaylistsPage extends HookConsumerWidget {
owner: me.asData!.value!,
images: [
SpotubeImageObject(
typeName: "image",
// typeName: "image",
url: Assets.images.likedTracks.path,
width: 300,
height: 300,

View File

@ -18,7 +18,10 @@ class MetadataPluginArtistTopTracksNotifier
mpscTx: await mpscTx,
);
return tracks.flatten();
return SpotubeFlattenedPaginationObject.from(
tracks,
(item) => SpotubeTrackObject.full(item.field0 as SpotubeFullTrackObject),
);
}
@override

View File

@ -6,9 +6,12 @@ class MetadataPlugin {
final SpotubePlugin plugin;
late final OpaqueSender sender;
MetadataPlugin({required this.sender, required this.plugin});
late Stream<AuthEventObject> _authStateStream;
MetadataPlugin({required this.sender, required this.plugin}) {
_authStateStream = plugin.authState().asBroadcastStream();
}
Stream<AuthEventObject> authState() => plugin.authState();
Stream<AuthEventObject> authState() => _authStateStream;
PluginAlbumSender get album => plugin.album;
PluginArtistSender get artist => plugin.artist;
@ -21,5 +24,7 @@ class MetadataPlugin {
PluginTrackSender get track => plugin.track;
PluginUserSender get user => plugin.user;
Future<void> close() => plugin.close(tx: sender);
Future<void> close() async {
await plugin.close(tx: sender);
}
}

View File

@ -23,7 +23,6 @@ enum SpotubeAlbumType {
@freezed
sealed class SpotubeFullAlbumObject with _$SpotubeFullAlbumObject {
const factory SpotubeFullAlbumObject({
required String typeName,
required String id,
required String name,
required List<SpotubeSimpleArtistObject> artists,
@ -43,7 +42,6 @@ sealed class SpotubeFullAlbumObject with _$SpotubeFullAlbumObject {
@freezed
sealed class SpotubeSimpleAlbumObject with _$SpotubeSimpleAlbumObject {
const factory SpotubeSimpleAlbumObject({
required String typeName,
required String id,
required String name,
required String externalUri,

View File

@ -21,7 +21,6 @@ SpotubeFullAlbumObject _$SpotubeFullAlbumObjectFromJson(
/// @nodoc
mixin _$SpotubeFullAlbumObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
List<SpotubeSimpleArtistObject> get artists =>
@ -51,8 +50,7 @@ abstract class $SpotubeFullAlbumObjectCopyWith<$Res> {
_$SpotubeFullAlbumObjectCopyWithImpl<$Res, SpotubeFullAlbumObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
List<SpotubeSimpleArtistObject> artists,
List<SpotubeImageObject> images,
@ -80,7 +78,6 @@ class _$SpotubeFullAlbumObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? artists = null,
@ -93,10 +90,6 @@ class _$SpotubeFullAlbumObjectCopyWithImpl<$Res,
Object? genres = freezed,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -151,8 +144,7 @@ abstract class _$$SpotubeFullAlbumObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
List<SpotubeSimpleArtistObject> artists,
List<SpotubeImageObject> images,
@ -179,7 +171,6 @@ class __$$SpotubeFullAlbumObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? artists = null,
@ -192,10 +183,6 @@ class __$$SpotubeFullAlbumObjectImplCopyWithImpl<$Res>
Object? genres = freezed,
}) {
return _then(_$SpotubeFullAlbumObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -244,8 +231,7 @@ class __$$SpotubeFullAlbumObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
const _$SpotubeFullAlbumObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required final List<SpotubeSimpleArtistObject> artists,
required final List<SpotubeImageObject> images,
@ -262,8 +248,6 @@ class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
factory _$SpotubeFullAlbumObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeFullAlbumObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -306,7 +290,7 @@ class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
@override
String toString() {
return 'SpotubeFullAlbumObject(typeName: $typeName, id: $id, name: $name, artists: $artists, images: $images, releaseDate: $releaseDate, externalUri: $externalUri, totalTracks: $totalTracks, albumType: $albumType, recordLabel: $recordLabel, genres: $genres)';
return 'SpotubeFullAlbumObject(id: $id, name: $name, artists: $artists, images: $images, releaseDate: $releaseDate, externalUri: $externalUri, totalTracks: $totalTracks, albumType: $albumType, recordLabel: $recordLabel, genres: $genres)';
}
@override
@ -314,8 +298,6 @@ class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeFullAlbumObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
const DeepCollectionEquality().equals(other._artists, _artists) &&
@ -337,7 +319,6 @@ class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
name,
const DeepCollectionEquality().hash(_artists),
@ -368,8 +349,7 @@ class _$SpotubeFullAlbumObjectImpl implements _SpotubeFullAlbumObject {
abstract class _SpotubeFullAlbumObject implements SpotubeFullAlbumObject {
const factory _SpotubeFullAlbumObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final List<SpotubeSimpleArtistObject> artists,
required final List<SpotubeImageObject> images,
@ -383,8 +363,6 @@ abstract class _SpotubeFullAlbumObject implements SpotubeFullAlbumObject {
factory _SpotubeFullAlbumObject.fromJson(Map<String, dynamic> json) =
_$SpotubeFullAlbumObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override
@ -421,7 +399,6 @@ SpotubeSimpleAlbumObject _$SpotubeSimpleAlbumObjectFromJson(
/// @nodoc
mixin _$SpotubeSimpleAlbumObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -448,8 +425,7 @@ abstract class $SpotubeSimpleAlbumObjectCopyWith<$Res> {
_$SpotubeSimpleAlbumObjectCopyWithImpl<$Res, SpotubeSimpleAlbumObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -474,7 +450,6 @@ class _$SpotubeSimpleAlbumObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -484,10 +459,6 @@ class _$SpotubeSimpleAlbumObjectCopyWithImpl<$Res,
Object? releaseDate = freezed,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -530,8 +501,7 @@ abstract class _$$SpotubeSimpleAlbumObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -555,7 +525,6 @@ class __$$SpotubeSimpleAlbumObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -565,10 +534,6 @@ class __$$SpotubeSimpleAlbumObjectImplCopyWithImpl<$Res>
Object? releaseDate = freezed,
}) {
return _then(_$SpotubeSimpleAlbumObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -605,8 +570,7 @@ class __$$SpotubeSimpleAlbumObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
const _$SpotubeSimpleAlbumObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -619,8 +583,6 @@ class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
factory _$SpotubeSimpleAlbumObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeSimpleAlbumObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -650,7 +612,7 @@ class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
@override
String toString() {
return 'SpotubeSimpleAlbumObject(typeName: $typeName, id: $id, name: $name, externalUri: $externalUri, artists: $artists, images: $images, albumType: $albumType, releaseDate: $releaseDate)';
return 'SpotubeSimpleAlbumObject(id: $id, name: $name, externalUri: $externalUri, artists: $artists, images: $images, albumType: $albumType, releaseDate: $releaseDate)';
}
@override
@ -658,8 +620,6 @@ class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeSimpleAlbumObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.externalUri, externalUri) ||
@ -676,7 +636,6 @@ class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
name,
externalUri,
@ -704,8 +663,7 @@ class _$SpotubeSimpleAlbumObjectImpl implements _SpotubeSimpleAlbumObject {
abstract class _SpotubeSimpleAlbumObject implements SpotubeSimpleAlbumObject {
const factory _SpotubeSimpleAlbumObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -716,8 +674,6 @@ abstract class _SpotubeSimpleAlbumObject implements SpotubeSimpleAlbumObject {
factory _SpotubeSimpleAlbumObject.fromJson(Map<String, dynamic> json) =
_$SpotubeSimpleAlbumObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -8,7 +8,6 @@ part of 'album.dart';
_$SpotubeFullAlbumObjectImpl _$$SpotubeFullAlbumObjectImplFromJson(Map json) =>
_$SpotubeFullAlbumObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
artists: (json['artists'] as List<dynamic>)
@ -31,7 +30,6 @@ _$SpotubeFullAlbumObjectImpl _$$SpotubeFullAlbumObjectImplFromJson(Map json) =>
Map<String, dynamic> _$$SpotubeFullAlbumObjectImplToJson(
_$SpotubeFullAlbumObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'artists': instance.artists.map((e) => e.toJson()).toList(),
@ -53,7 +51,6 @@ const _$SpotubeAlbumTypeEnumMap = {
_$SpotubeSimpleAlbumObjectImpl _$$SpotubeSimpleAlbumObjectImplFromJson(
Map json) =>
_$SpotubeSimpleAlbumObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
externalUri: json['externalUri'] as String,
@ -72,7 +69,6 @@ _$SpotubeSimpleAlbumObjectImpl _$$SpotubeSimpleAlbumObjectImplFromJson(
Map<String, dynamic> _$$SpotubeSimpleAlbumObjectImplToJson(
_$SpotubeSimpleAlbumObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'externalUri': instance.externalUri,

View File

@ -15,7 +15,6 @@ part 'artist.g.dart';
@freezed
sealed class SpotubeFullArtistObject with _$SpotubeFullArtistObject {
const factory SpotubeFullArtistObject({
required String typeName,
required String id,
required String name,
required String externalUri,
@ -31,7 +30,6 @@ sealed class SpotubeFullArtistObject with _$SpotubeFullArtistObject {
@freezed
sealed class SpotubeSimpleArtistObject with _$SpotubeSimpleArtistObject {
const factory SpotubeSimpleArtistObject({
required String typeName,
required String id,
required String name,
required String externalUri,

View File

@ -21,7 +21,6 @@ SpotubeFullArtistObject _$SpotubeFullArtistObjectFromJson(
/// @nodoc
mixin _$SpotubeFullArtistObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -46,8 +45,7 @@ abstract class $SpotubeFullArtistObjectCopyWith<$Res> {
_$SpotubeFullArtistObjectCopyWithImpl<$Res, SpotubeFullArtistObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeImageObject> images,
@ -71,7 +69,6 @@ class _$SpotubeFullArtistObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -80,10 +77,6 @@ class _$SpotubeFullArtistObjectCopyWithImpl<$Res,
Object? followers = freezed,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -122,8 +115,7 @@ abstract class _$$SpotubeFullArtistObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeImageObject> images,
@ -146,7 +138,6 @@ class __$$SpotubeFullArtistObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -155,10 +146,6 @@ class __$$SpotubeFullArtistObjectImplCopyWithImpl<$Res>
Object? followers = freezed,
}) {
return _then(_$SpotubeFullArtistObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -191,8 +178,7 @@ class __$$SpotubeFullArtistObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
const _$SpotubeFullArtistObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.externalUri,
required final List<SpotubeImageObject> images,
@ -204,8 +190,6 @@ class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
factory _$SpotubeFullArtistObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeFullArtistObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -235,7 +219,7 @@ class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
@override
String toString() {
return 'SpotubeFullArtistObject(typeName: $typeName, id: $id, name: $name, externalUri: $externalUri, images: $images, genres: $genres, followers: $followers)';
return 'SpotubeFullArtistObject(id: $id, name: $name, externalUri: $externalUri, images: $images, genres: $genres, followers: $followers)';
}
@override
@ -243,8 +227,6 @@ class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeFullArtistObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.externalUri, externalUri) ||
@ -259,7 +241,6 @@ class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
name,
externalUri,
@ -286,8 +267,7 @@ class _$SpotubeFullArtistObjectImpl implements _SpotubeFullArtistObject {
abstract class _SpotubeFullArtistObject implements SpotubeFullArtistObject {
const factory _SpotubeFullArtistObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String externalUri,
required final List<SpotubeImageObject> images,
@ -297,8 +277,6 @@ abstract class _SpotubeFullArtistObject implements SpotubeFullArtistObject {
factory _SpotubeFullArtistObject.fromJson(Map<String, dynamic> json) =
_$SpotubeFullArtistObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override
@ -327,7 +305,6 @@ SpotubeSimpleArtistObject _$SpotubeSimpleArtistObjectFromJson(
/// @nodoc
mixin _$SpotubeSimpleArtistObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -350,8 +327,7 @@ abstract class $SpotubeSimpleArtistObjectCopyWith<$Res> {
_$SpotubeSimpleArtistObjectCopyWithImpl<$Res, SpotubeSimpleArtistObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeImageObject>? images});
@ -373,17 +349,12 @@ class _$SpotubeSimpleArtistObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
Object? images = freezed,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -414,8 +385,7 @@ abstract class _$$SpotubeSimpleArtistObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeImageObject>? images});
@ -436,17 +406,12 @@ class __$$SpotubeSimpleArtistObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
Object? images = freezed,
}) {
return _then(_$SpotubeSimpleArtistObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -471,8 +436,7 @@ class __$$SpotubeSimpleArtistObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
const _$SpotubeSimpleArtistObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.externalUri,
final List<SpotubeImageObject>? images})
@ -481,8 +445,6 @@ class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
factory _$SpotubeSimpleArtistObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeSimpleArtistObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -501,7 +463,7 @@ class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
@override
String toString() {
return 'SpotubeSimpleArtistObject(typeName: $typeName, id: $id, name: $name, externalUri: $externalUri, images: $images)';
return 'SpotubeSimpleArtistObject(id: $id, name: $name, externalUri: $externalUri, images: $images)';
}
@override
@ -509,8 +471,6 @@ class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeSimpleArtistObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.externalUri, externalUri) ||
@ -520,7 +480,7 @@ class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, typeName, id, name, externalUri,
int get hashCode => Object.hash(runtimeType, id, name, externalUri,
const DeepCollectionEquality().hash(_images));
/// Create a copy of SpotubeSimpleArtistObject
@ -542,8 +502,7 @@ class _$SpotubeSimpleArtistObjectImpl implements _SpotubeSimpleArtistObject {
abstract class _SpotubeSimpleArtistObject implements SpotubeSimpleArtistObject {
const factory _SpotubeSimpleArtistObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String externalUri,
final List<SpotubeImageObject>? images}) =
@ -552,8 +511,6 @@ abstract class _SpotubeSimpleArtistObject implements SpotubeSimpleArtistObject {
factory _SpotubeSimpleArtistObject.fromJson(Map<String, dynamic> json) =
_$SpotubeSimpleArtistObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -9,7 +9,6 @@ part of 'artist.dart';
_$SpotubeFullArtistObjectImpl _$$SpotubeFullArtistObjectImplFromJson(
Map json) =>
_$SpotubeFullArtistObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
externalUri: json['externalUri'] as String,
@ -25,7 +24,6 @@ _$SpotubeFullArtistObjectImpl _$$SpotubeFullArtistObjectImplFromJson(
Map<String, dynamic> _$$SpotubeFullArtistObjectImplToJson(
_$SpotubeFullArtistObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'externalUri': instance.externalUri,
@ -37,7 +35,6 @@ Map<String, dynamic> _$$SpotubeFullArtistObjectImplToJson(
_$SpotubeSimpleArtistObjectImpl _$$SpotubeSimpleArtistObjectImplFromJson(
Map json) =>
_$SpotubeSimpleArtistObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
externalUri: json['externalUri'] as String,
@ -50,7 +47,6 @@ _$SpotubeSimpleArtistObjectImpl _$$SpotubeSimpleArtistObjectImplFromJson(
Map<String, dynamic> _$$SpotubeSimpleArtistObjectImplToJson(
_$SpotubeSimpleArtistObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'externalUri': instance.externalUri,

View File

@ -76,7 +76,6 @@ sealed class SpotubeAudioSourceContainerPreset
sealed class SpotubeAudioSourceMatchObject
with _$SpotubeAudioSourceMatchObject {
const factory SpotubeAudioSourceMatchObject({
required String typeName,
required String id,
required String title,
required List<String> artists,

View File

@ -969,7 +969,6 @@ SpotubeAudioSourceMatchObject _$SpotubeAudioSourceMatchObjectFromJson(
/// @nodoc
mixin _$SpotubeAudioSourceMatchObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get title => throw _privateConstructorUsedError;
List<String> get artists => throw _privateConstructorUsedError;
@ -996,8 +995,7 @@ abstract class $SpotubeAudioSourceMatchObjectCopyWith<$Res> {
SpotubeAudioSourceMatchObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String title,
List<String> artists,
int duration,
@ -1021,7 +1019,6 @@ class _$SpotubeAudioSourceMatchObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? title = null,
Object? artists = null,
@ -1030,10 +1027,6 @@ class _$SpotubeAudioSourceMatchObjectCopyWithImpl<$Res,
Object? externalUri = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -1072,8 +1065,7 @@ abstract class _$$SpotubeAudioSourceMatchObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String title,
List<String> artists,
int duration,
@ -1096,7 +1088,6 @@ class __$$SpotubeAudioSourceMatchObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? title = null,
Object? artists = null,
@ -1105,10 +1096,6 @@ class __$$SpotubeAudioSourceMatchObjectImplCopyWithImpl<$Res>
Object? externalUri = null,
}) {
return _then(_$SpotubeAudioSourceMatchObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -1142,8 +1129,7 @@ class __$$SpotubeAudioSourceMatchObjectImplCopyWithImpl<$Res>
class _$SpotubeAudioSourceMatchObjectImpl
implements _SpotubeAudioSourceMatchObject {
const _$SpotubeAudioSourceMatchObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.title,
required final List<String> artists,
required this.duration,
@ -1155,8 +1141,6 @@ class _$SpotubeAudioSourceMatchObjectImpl
Map<String, dynamic> json) =>
_$$SpotubeAudioSourceMatchObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -1178,7 +1162,7 @@ class _$SpotubeAudioSourceMatchObjectImpl
@override
String toString() {
return 'SpotubeAudioSourceMatchObject(typeName: $typeName, id: $id, title: $title, artists: $artists, duration: $duration, thumbnail: $thumbnail, externalUri: $externalUri)';
return 'SpotubeAudioSourceMatchObject(id: $id, title: $title, artists: $artists, duration: $duration, thumbnail: $thumbnail, externalUri: $externalUri)';
}
@override
@ -1186,8 +1170,6 @@ class _$SpotubeAudioSourceMatchObjectImpl
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeAudioSourceMatchObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.title, title) || other.title == title) &&
const DeepCollectionEquality().equals(other._artists, _artists) &&
@ -1203,7 +1185,6 @@ class _$SpotubeAudioSourceMatchObjectImpl
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
title,
const DeepCollectionEquality().hash(_artists),
@ -1232,8 +1213,7 @@ class _$SpotubeAudioSourceMatchObjectImpl
abstract class _SpotubeAudioSourceMatchObject
implements SpotubeAudioSourceMatchObject {
const factory _SpotubeAudioSourceMatchObject(
{required final String typeName,
required final String id,
{required final String id,
required final String title,
required final List<String> artists,
required final int duration,
@ -1243,8 +1223,6 @@ abstract class _SpotubeAudioSourceMatchObject
factory _SpotubeAudioSourceMatchObject.fromJson(Map<String, dynamic> json) =
_$SpotubeAudioSourceMatchObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -86,7 +86,6 @@ Map<String, dynamic> _$$SpotubeAudioSourceContainerPreset_LosslessImplToJson(
_$SpotubeAudioSourceMatchObjectImpl
_$$SpotubeAudioSourceMatchObjectImplFromJson(Map json) =>
_$SpotubeAudioSourceMatchObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
title: json['title'] as String,
artists: (json['artists'] as List<dynamic>)
@ -100,7 +99,6 @@ _$SpotubeAudioSourceMatchObjectImpl
Map<String, dynamic> _$$SpotubeAudioSourceMatchObjectImplToJson(
_$SpotubeAudioSourceMatchObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'title': instance.title,
'artists': instance.artists,

View File

@ -19,7 +19,6 @@ part 'browse.freezed.dart';
@freezed
sealed class SpotubeBrowseSectionObject with _$SpotubeBrowseSectionObject {
const factory SpotubeBrowseSectionObject({
required String typeName,
required String id,
required String title,
required String externalUri,

View File

@ -16,7 +16,6 @@ final _privateConstructorUsedError = UnsupportedError(
/// @nodoc
mixin _$SpotubeBrowseSectionObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get title => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -39,8 +38,7 @@ abstract class $SpotubeBrowseSectionObjectCopyWith<$Res> {
SpotubeBrowseSectionObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String title,
String externalUri,
bool browseMore,
@ -63,7 +61,6 @@ class _$SpotubeBrowseSectionObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? title = null,
Object? externalUri = null,
@ -71,10 +68,6 @@ class _$SpotubeBrowseSectionObjectCopyWithImpl<$Res,
Object? items = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -109,8 +102,7 @@ abstract class _$$SpotubeBrowseSectionObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String title,
String externalUri,
bool browseMore,
@ -132,7 +124,6 @@ class __$$SpotubeBrowseSectionObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? title = null,
Object? externalUri = null,
@ -140,10 +131,6 @@ class __$$SpotubeBrowseSectionObjectImplCopyWithImpl<$Res>
Object? items = null,
}) {
return _then(_$SpotubeBrowseSectionObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -172,16 +159,13 @@ class __$$SpotubeBrowseSectionObjectImplCopyWithImpl<$Res>
class _$SpotubeBrowseSectionObjectImpl implements _SpotubeBrowseSectionObject {
const _$SpotubeBrowseSectionObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.title,
required this.externalUri,
required this.browseMore,
required final List<SpotubeBrowseSectionResponseObjectItem> items})
: _items = items;
@override
final String typeName;
@override
final String id;
@override
@ -200,7 +184,7 @@ class _$SpotubeBrowseSectionObjectImpl implements _SpotubeBrowseSectionObject {
@override
String toString() {
return 'SpotubeBrowseSectionObject(typeName: $typeName, id: $id, title: $title, externalUri: $externalUri, browseMore: $browseMore, items: $items)';
return 'SpotubeBrowseSectionObject(id: $id, title: $title, externalUri: $externalUri, browseMore: $browseMore, items: $items)';
}
@override
@ -208,8 +192,6 @@ class _$SpotubeBrowseSectionObjectImpl implements _SpotubeBrowseSectionObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeBrowseSectionObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.title, title) || other.title == title) &&
(identical(other.externalUri, externalUri) ||
@ -220,7 +202,7 @@ class _$SpotubeBrowseSectionObjectImpl implements _SpotubeBrowseSectionObject {
}
@override
int get hashCode => Object.hash(runtimeType, typeName, id, title, externalUri,
int get hashCode => Object.hash(runtimeType, id, title, externalUri,
browseMore, const DeepCollectionEquality().hash(_items));
/// Create a copy of SpotubeBrowseSectionObject
@ -236,16 +218,13 @@ class _$SpotubeBrowseSectionObjectImpl implements _SpotubeBrowseSectionObject {
abstract class _SpotubeBrowseSectionObject
implements SpotubeBrowseSectionObject {
const factory _SpotubeBrowseSectionObject(
{required final String typeName,
required final String id,
{required final String id,
required final String title,
required final String externalUri,
required final bool browseMore,
required final List<SpotubeBrowseSectionResponseObjectItem> items}) =
_$SpotubeBrowseSectionObjectImpl;
@override
String get typeName;
@override
String get id;
@override

View File

@ -14,7 +14,6 @@ part 'image.g.dart';
@freezed
sealed class SpotubeImageObject with _$SpotubeImageObject {
const factory SpotubeImageObject({
required String typeName,
required String url,
int? width,
int? height,

View File

@ -20,7 +20,6 @@ SpotubeImageObject _$SpotubeImageObjectFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$SpotubeImageObject {
String get typeName => throw _privateConstructorUsedError;
String get url => throw _privateConstructorUsedError;
int? get width => throw _privateConstructorUsedError;
int? get height => throw _privateConstructorUsedError;
@ -41,7 +40,7 @@ abstract class $SpotubeImageObjectCopyWith<$Res> {
SpotubeImageObject value, $Res Function(SpotubeImageObject) then) =
_$SpotubeImageObjectCopyWithImpl<$Res, SpotubeImageObject>;
@useResult
$Res call({String typeName, String url, int? width, int? height});
$Res call({String url, int? width, int? height});
}
/// @nodoc
@ -59,16 +58,11 @@ class _$SpotubeImageObjectCopyWithImpl<$Res, $Val extends SpotubeImageObject>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? url = null,
Object? width = freezed,
Object? height = freezed,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
url: null == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
@ -93,7 +87,7 @@ abstract class _$$SpotubeImageObjectImplCopyWith<$Res>
__$$SpotubeImageObjectImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String typeName, String url, int? width, int? height});
$Res call({String url, int? width, int? height});
}
/// @nodoc
@ -109,16 +103,11 @@ class __$$SpotubeImageObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? url = null,
Object? width = freezed,
Object? height = freezed,
}) {
return _then(_$SpotubeImageObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
url: null == url
? _value.url
: url // ignore: cast_nullable_to_non_nullable
@ -138,14 +127,11 @@ class __$$SpotubeImageObjectImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$SpotubeImageObjectImpl implements _SpotubeImageObject {
const _$SpotubeImageObjectImpl(
{required this.typeName, required this.url, this.width, this.height});
const _$SpotubeImageObjectImpl({required this.url, this.width, this.height});
factory _$SpotubeImageObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeImageObjectImplFromJson(json);
@override
final String typeName;
@override
final String url;
@override
@ -155,7 +141,7 @@ class _$SpotubeImageObjectImpl implements _SpotubeImageObject {
@override
String toString() {
return 'SpotubeImageObject(typeName: $typeName, url: $url, width: $width, height: $height)';
return 'SpotubeImageObject(url: $url, width: $width, height: $height)';
}
@override
@ -163,8 +149,6 @@ class _$SpotubeImageObjectImpl implements _SpotubeImageObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeImageObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.url, url) || other.url == url) &&
(identical(other.width, width) || other.width == width) &&
(identical(other.height, height) || other.height == height));
@ -172,7 +156,7 @@ class _$SpotubeImageObjectImpl implements _SpotubeImageObject {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, typeName, url, width, height);
int get hashCode => Object.hash(runtimeType, url, width, height);
/// Create a copy of SpotubeImageObject
/// with the given fields replaced by the non-null parameter values.
@ -193,16 +177,13 @@ class _$SpotubeImageObjectImpl implements _SpotubeImageObject {
abstract class _SpotubeImageObject implements SpotubeImageObject {
const factory _SpotubeImageObject(
{required final String typeName,
required final String url,
{required final String url,
final int? width,
final int? height}) = _$SpotubeImageObjectImpl;
factory _SpotubeImageObject.fromJson(Map<String, dynamic> json) =
_$SpotubeImageObjectImpl.fromJson;
@override
String get typeName;
@override
String get url;
@override

View File

@ -8,7 +8,6 @@ part of 'image.dart';
_$SpotubeImageObjectImpl _$$SpotubeImageObjectImplFromJson(Map json) =>
_$SpotubeImageObjectImpl(
typeName: json['typeName'] as String,
url: json['url'] as String,
width: (json['width'] as num?)?.toInt(),
height: (json['height'] as num?)?.toInt(),
@ -17,7 +16,6 @@ _$SpotubeImageObjectImpl _$$SpotubeImageObjectImplFromJson(Map json) =>
Map<String, dynamic> _$$SpotubeImageObjectImplToJson(
_$SpotubeImageObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'url': instance.url,
'width': instance.width,
'height': instance.height,

View File

@ -16,7 +16,6 @@ part 'playlist.g.dart';
@freezed
sealed class SpotubeFullPlaylistObject with _$SpotubeFullPlaylistObject {
const factory SpotubeFullPlaylistObject({
required String typeName,
required String id,
required String name,
required String description,
@ -35,7 +34,6 @@ sealed class SpotubeFullPlaylistObject with _$SpotubeFullPlaylistObject {
@freezed
sealed class SpotubeSimplePlaylistObject with _$SpotubeSimplePlaylistObject {
const factory SpotubeSimplePlaylistObject({
required String typeName,
required String id,
required String name,
required String description,

View File

@ -21,7 +21,6 @@ SpotubeFullPlaylistObject _$SpotubeFullPlaylistObjectFromJson(
/// @nodoc
mixin _$SpotubeFullPlaylistObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get description => throw _privateConstructorUsedError;
@ -50,8 +49,7 @@ abstract class $SpotubeFullPlaylistObjectCopyWith<$Res> {
_$SpotubeFullPlaylistObjectCopyWithImpl<$Res, SpotubeFullPlaylistObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String description,
String externalUri,
@ -80,7 +78,6 @@ class _$SpotubeFullPlaylistObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? description = null,
@ -92,10 +89,6 @@ class _$SpotubeFullPlaylistObjectCopyWithImpl<$Res,
Object? public = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -156,8 +149,7 @@ abstract class _$$SpotubeFullPlaylistObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String description,
String externalUri,
@ -186,7 +178,6 @@ class __$$SpotubeFullPlaylistObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? description = null,
@ -198,10 +189,6 @@ class __$$SpotubeFullPlaylistObjectImplCopyWithImpl<$Res>
Object? public = null,
}) {
return _then(_$SpotubeFullPlaylistObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -246,8 +233,7 @@ class __$$SpotubeFullPlaylistObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
const _$SpotubeFullPlaylistObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.description,
required this.externalUri,
@ -262,8 +248,6 @@ class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
factory _$SpotubeFullPlaylistObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeFullPlaylistObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -297,7 +281,7 @@ class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
@override
String toString() {
return 'SpotubeFullPlaylistObject(typeName: $typeName, id: $id, name: $name, description: $description, externalUri: $externalUri, owner: $owner, images: $images, collaborators: $collaborators, collaborative: $collaborative, public: $public)';
return 'SpotubeFullPlaylistObject(id: $id, name: $name, description: $description, externalUri: $externalUri, owner: $owner, images: $images, collaborators: $collaborators, collaborative: $collaborative, public: $public)';
}
@override
@ -305,8 +289,6 @@ class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeFullPlaylistObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.description, description) ||
@ -326,7 +308,6 @@ class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
name,
description,
@ -356,8 +337,7 @@ class _$SpotubeFullPlaylistObjectImpl implements _SpotubeFullPlaylistObject {
abstract class _SpotubeFullPlaylistObject implements SpotubeFullPlaylistObject {
const factory _SpotubeFullPlaylistObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String description,
required final String externalUri,
@ -370,8 +350,6 @@ abstract class _SpotubeFullPlaylistObject implements SpotubeFullPlaylistObject {
factory _SpotubeFullPlaylistObject.fromJson(Map<String, dynamic> json) =
_$SpotubeFullPlaylistObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override
@ -406,7 +384,6 @@ SpotubeSimplePlaylistObject _$SpotubeSimplePlaylistObjectFromJson(
/// @nodoc
mixin _$SpotubeSimplePlaylistObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get description => throw _privateConstructorUsedError;
@ -433,8 +410,7 @@ abstract class $SpotubeSimplePlaylistObjectCopyWith<$Res> {
SpotubeSimplePlaylistObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String description,
String externalUri,
@ -460,7 +436,6 @@ class _$SpotubeSimplePlaylistObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? description = null,
@ -469,10 +444,6 @@ class _$SpotubeSimplePlaylistObjectCopyWithImpl<$Res,
Object? images = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -521,8 +492,7 @@ abstract class _$$SpotubeSimplePlaylistObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String description,
String externalUri,
@ -548,7 +518,6 @@ class __$$SpotubeSimplePlaylistObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? description = null,
@ -557,10 +526,6 @@ class __$$SpotubeSimplePlaylistObjectImplCopyWithImpl<$Res>
Object? images = null,
}) {
return _then(_$SpotubeSimplePlaylistObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -594,8 +559,7 @@ class __$$SpotubeSimplePlaylistObjectImplCopyWithImpl<$Res>
class _$SpotubeSimplePlaylistObjectImpl
implements _SpotubeSimplePlaylistObject {
const _$SpotubeSimplePlaylistObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.description,
required this.externalUri,
@ -607,8 +571,6 @@ class _$SpotubeSimplePlaylistObjectImpl
Map<String, dynamic> json) =>
_$$SpotubeSimplePlaylistObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -629,7 +591,7 @@ class _$SpotubeSimplePlaylistObjectImpl
@override
String toString() {
return 'SpotubeSimplePlaylistObject(typeName: $typeName, id: $id, name: $name, description: $description, externalUri: $externalUri, owner: $owner, images: $images)';
return 'SpotubeSimplePlaylistObject(id: $id, name: $name, description: $description, externalUri: $externalUri, owner: $owner, images: $images)';
}
@override
@ -637,8 +599,6 @@ class _$SpotubeSimplePlaylistObjectImpl
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeSimplePlaylistObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.description, description) ||
@ -651,7 +611,7 @@ class _$SpotubeSimplePlaylistObjectImpl
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, typeName, id, name, description,
int get hashCode => Object.hash(runtimeType, id, name, description,
externalUri, owner, const DeepCollectionEquality().hash(_images));
/// Create a copy of SpotubeSimplePlaylistObject
@ -674,8 +634,7 @@ class _$SpotubeSimplePlaylistObjectImpl
abstract class _SpotubeSimplePlaylistObject
implements SpotubeSimplePlaylistObject {
const factory _SpotubeSimplePlaylistObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String description,
required final String externalUri,
@ -686,8 +645,6 @@ abstract class _SpotubeSimplePlaylistObject
factory _SpotubeSimplePlaylistObject.fromJson(Map<String, dynamic> json) =
_$SpotubeSimplePlaylistObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -9,7 +9,6 @@ part of 'playlist.dart';
_$SpotubeFullPlaylistObjectImpl _$$SpotubeFullPlaylistObjectImplFromJson(
Map json) =>
_$SpotubeFullPlaylistObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
description: json['description'] as String,
@ -31,7 +30,6 @@ _$SpotubeFullPlaylistObjectImpl _$$SpotubeFullPlaylistObjectImplFromJson(
Map<String, dynamic> _$$SpotubeFullPlaylistObjectImplToJson(
_$SpotubeFullPlaylistObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'description': instance.description,
@ -46,7 +44,6 @@ Map<String, dynamic> _$$SpotubeFullPlaylistObjectImplToJson(
_$SpotubeSimplePlaylistObjectImpl _$$SpotubeSimplePlaylistObjectImplFromJson(
Map json) =>
_$SpotubeSimplePlaylistObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
description: json['description'] as String,
@ -62,7 +59,6 @@ _$SpotubeSimplePlaylistObjectImpl _$$SpotubeSimplePlaylistObjectImplFromJson(
Map<String, dynamic> _$$SpotubeSimplePlaylistObjectImplToJson(
_$SpotubeSimplePlaylistObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'description': instance.description,

View File

@ -20,7 +20,6 @@ part 'search.g.dart';
@freezed
sealed class SpotubeSearchResponseObject with _$SpotubeSearchResponseObject {
const factory SpotubeSearchResponseObject({
required String typeName,
required List<SpotubeSimpleAlbumObject> albums,
required List<SpotubeFullArtistObject> artists,
required List<SpotubeSimplePlaylistObject> playlists,

View File

@ -21,7 +21,6 @@ SpotubeSearchResponseObject _$SpotubeSearchResponseObjectFromJson(
/// @nodoc
mixin _$SpotubeSearchResponseObject {
String get typeName => throw _privateConstructorUsedError;
List<SpotubeSimpleAlbumObject> get albums =>
throw _privateConstructorUsedError;
List<SpotubeFullArtistObject> get artists =>
@ -49,8 +48,7 @@ abstract class $SpotubeSearchResponseObjectCopyWith<$Res> {
SpotubeSearchResponseObject>;
@useResult
$Res call(
{String typeName,
List<SpotubeSimpleAlbumObject> albums,
{List<SpotubeSimpleAlbumObject> albums,
List<SpotubeFullArtistObject> artists,
List<SpotubeSimplePlaylistObject> playlists,
List<SpotubeFullTrackObject> tracks});
@ -72,17 +70,12 @@ class _$SpotubeSearchResponseObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? albums = null,
Object? artists = null,
Object? playlists = null,
Object? tracks = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
albums: null == albums
? _value.albums
: albums // ignore: cast_nullable_to_non_nullable
@ -113,8 +106,7 @@ abstract class _$$SpotubeSearchResponseObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
List<SpotubeSimpleAlbumObject> albums,
{List<SpotubeSimpleAlbumObject> albums,
List<SpotubeFullArtistObject> artists,
List<SpotubeSimplePlaylistObject> playlists,
List<SpotubeFullTrackObject> tracks});
@ -135,17 +127,12 @@ class __$$SpotubeSearchResponseObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? albums = null,
Object? artists = null,
Object? playlists = null,
Object? tracks = null,
}) {
return _then(_$SpotubeSearchResponseObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
albums: null == albums
? _value._albums
: albums // ignore: cast_nullable_to_non_nullable
@ -171,8 +158,7 @@ class __$$SpotubeSearchResponseObjectImplCopyWithImpl<$Res>
class _$SpotubeSearchResponseObjectImpl
implements _SpotubeSearchResponseObject {
const _$SpotubeSearchResponseObjectImpl(
{required this.typeName,
required final List<SpotubeSimpleAlbumObject> albums,
{required final List<SpotubeSimpleAlbumObject> albums,
required final List<SpotubeFullArtistObject> artists,
required final List<SpotubeSimplePlaylistObject> playlists,
required final List<SpotubeFullTrackObject> tracks})
@ -185,8 +171,6 @@ class _$SpotubeSearchResponseObjectImpl
Map<String, dynamic> json) =>
_$$SpotubeSearchResponseObjectImplFromJson(json);
@override
final String typeName;
final List<SpotubeSimpleAlbumObject> _albums;
@override
List<SpotubeSimpleAlbumObject> get albums {
@ -221,7 +205,7 @@ class _$SpotubeSearchResponseObjectImpl
@override
String toString() {
return 'SpotubeSearchResponseObject(typeName: $typeName, albums: $albums, artists: $artists, playlists: $playlists, tracks: $tracks)';
return 'SpotubeSearchResponseObject(albums: $albums, artists: $artists, playlists: $playlists, tracks: $tracks)';
}
@override
@ -229,8 +213,6 @@ class _$SpotubeSearchResponseObjectImpl
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeSearchResponseObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
const DeepCollectionEquality().equals(other._albums, _albums) &&
const DeepCollectionEquality().equals(other._artists, _artists) &&
const DeepCollectionEquality()
@ -242,7 +224,6 @@ class _$SpotubeSearchResponseObjectImpl
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
const DeepCollectionEquality().hash(_albums),
const DeepCollectionEquality().hash(_artists),
const DeepCollectionEquality().hash(_playlists),
@ -268,8 +249,7 @@ class _$SpotubeSearchResponseObjectImpl
abstract class _SpotubeSearchResponseObject
implements SpotubeSearchResponseObject {
const factory _SpotubeSearchResponseObject(
{required final String typeName,
required final List<SpotubeSimpleAlbumObject> albums,
{required final List<SpotubeSimpleAlbumObject> albums,
required final List<SpotubeFullArtistObject> artists,
required final List<SpotubeSimplePlaylistObject> playlists,
required final List<SpotubeFullTrackObject> tracks}) =
@ -278,8 +258,6 @@ abstract class _SpotubeSearchResponseObject
factory _SpotubeSearchResponseObject.fromJson(Map<String, dynamic> json) =
_$SpotubeSearchResponseObjectImpl.fromJson;
@override
String get typeName;
@override
List<SpotubeSimpleAlbumObject> get albums;
@override

View File

@ -9,7 +9,6 @@ part of 'search.dart';
_$SpotubeSearchResponseObjectImpl _$$SpotubeSearchResponseObjectImplFromJson(
Map json) =>
_$SpotubeSearchResponseObjectImpl(
typeName: json['typeName'] as String,
albums: (json['albums'] as List<dynamic>)
.map((e) => SpotubeSimpleAlbumObject.fromJson(
Map<String, dynamic>.from(e as Map)))
@ -31,7 +30,6 @@ _$SpotubeSearchResponseObjectImpl _$$SpotubeSearchResponseObjectImplFromJson(
Map<String, dynamic> _$$SpotubeSearchResponseObjectImplToJson(
_$SpotubeSearchResponseObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'albums': instance.albums.map((e) => e.toJson()).toList(),
'artists': instance.artists.map((e) => e.toJson()).toList(),
'playlists': instance.playlists.map((e) => e.toJson()).toList(),

View File

@ -17,7 +17,6 @@ part 'track.g.dart';
@freezed
sealed class SpotubeFullTrackObject with _$SpotubeFullTrackObject {
const factory SpotubeFullTrackObject({
required String typeName,
required String id,
required String name,
required String externalUri,
@ -35,7 +34,6 @@ sealed class SpotubeFullTrackObject with _$SpotubeFullTrackObject {
@freezed
sealed class SpotubeLocalTrackObject with _$SpotubeLocalTrackObject {
const factory SpotubeLocalTrackObject({
required String typeName,
required String id,
required String name,
required String externalUri,

View File

@ -21,7 +21,6 @@ SpotubeFullTrackObject _$SpotubeFullTrackObjectFromJson(
/// @nodoc
mixin _$SpotubeFullTrackObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -49,8 +48,7 @@ abstract class $SpotubeFullTrackObjectCopyWith<$Res> {
_$SpotubeFullTrackObjectCopyWithImpl<$Res, SpotubeFullTrackObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -78,7 +76,6 @@ class _$SpotubeFullTrackObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -89,10 +86,6 @@ class _$SpotubeFullTrackObjectCopyWithImpl<$Res,
Object? explicit = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -149,8 +142,7 @@ abstract class _$$SpotubeFullTrackObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -178,7 +170,6 @@ class __$$SpotubeFullTrackObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -189,10 +180,6 @@ class __$$SpotubeFullTrackObjectImplCopyWithImpl<$Res>
Object? explicit = null,
}) {
return _then(_$SpotubeFullTrackObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -233,8 +220,7 @@ class __$$SpotubeFullTrackObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
const _$SpotubeFullTrackObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -247,8 +233,6 @@ class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
factory _$SpotubeFullTrackObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeFullTrackObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -274,7 +258,7 @@ class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
@override
String toString() {
return 'SpotubeFullTrackObject(typeName: $typeName, id: $id, name: $name, externalUri: $externalUri, artists: $artists, album: $album, durationMs: $durationMs, isrc: $isrc, explicit: $explicit)';
return 'SpotubeFullTrackObject(id: $id, name: $name, externalUri: $externalUri, artists: $artists, album: $album, durationMs: $durationMs, isrc: $isrc, explicit: $explicit)';
}
@override
@ -282,8 +266,6 @@ class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeFullTrackObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.externalUri, externalUri) ||
@ -301,7 +283,6 @@ class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
@override
int get hashCode => Object.hash(
runtimeType,
typeName,
id,
name,
externalUri,
@ -330,8 +311,7 @@ class _$SpotubeFullTrackObjectImpl implements _SpotubeFullTrackObject {
abstract class _SpotubeFullTrackObject implements SpotubeFullTrackObject {
const factory _SpotubeFullTrackObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -343,8 +323,6 @@ abstract class _SpotubeFullTrackObject implements SpotubeFullTrackObject {
factory _SpotubeFullTrackObject.fromJson(Map<String, dynamic> json) =
_$SpotubeFullTrackObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override
@ -377,7 +355,6 @@ SpotubeLocalTrackObject _$SpotubeLocalTrackObjectFromJson(
/// @nodoc
mixin _$SpotubeLocalTrackObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
String get externalUri => throw _privateConstructorUsedError;
@ -404,8 +381,7 @@ abstract class $SpotubeLocalTrackObjectCopyWith<$Res> {
_$SpotubeLocalTrackObjectCopyWithImpl<$Res, SpotubeLocalTrackObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -432,7 +408,6 @@ class _$SpotubeLocalTrackObjectCopyWithImpl<$Res,
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -442,10 +417,6 @@ class _$SpotubeLocalTrackObjectCopyWithImpl<$Res,
Object? path = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -498,8 +469,7 @@ abstract class _$$SpotubeLocalTrackObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
String externalUri,
List<SpotubeSimpleArtistObject> artists,
@ -526,7 +496,6 @@ class __$$SpotubeLocalTrackObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? externalUri = null,
@ -536,10 +505,6 @@ class __$$SpotubeLocalTrackObjectImplCopyWithImpl<$Res>
Object? path = null,
}) {
return _then(_$SpotubeLocalTrackObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -576,8 +541,7 @@ class __$$SpotubeLocalTrackObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
const _$SpotubeLocalTrackObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required this.externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -589,8 +553,6 @@ class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
factory _$SpotubeLocalTrackObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeLocalTrackObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -614,7 +576,7 @@ class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
@override
String toString() {
return 'SpotubeLocalTrackObject(typeName: $typeName, id: $id, name: $name, externalUri: $externalUri, artists: $artists, album: $album, durationMs: $durationMs, path: $path)';
return 'SpotubeLocalTrackObject(id: $id, name: $name, externalUri: $externalUri, artists: $artists, album: $album, durationMs: $durationMs, path: $path)';
}
@override
@ -622,8 +584,6 @@ class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeLocalTrackObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
(identical(other.externalUri, externalUri) ||
@ -637,7 +597,7 @@ class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, typeName, id, name, externalUri,
int get hashCode => Object.hash(runtimeType, id, name, externalUri,
const DeepCollectionEquality().hash(_artists), album, durationMs, path);
/// Create a copy of SpotubeLocalTrackObject
@ -659,8 +619,7 @@ class _$SpotubeLocalTrackObjectImpl implements _SpotubeLocalTrackObject {
abstract class _SpotubeLocalTrackObject implements SpotubeLocalTrackObject {
const factory _SpotubeLocalTrackObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final String externalUri,
required final List<SpotubeSimpleArtistObject> artists,
@ -671,8 +630,6 @@ abstract class _SpotubeLocalTrackObject implements SpotubeLocalTrackObject {
factory _SpotubeLocalTrackObject.fromJson(Map<String, dynamic> json) =
_$SpotubeLocalTrackObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -8,7 +8,6 @@ part of 'track.dart';
_$SpotubeFullTrackObjectImpl _$$SpotubeFullTrackObjectImplFromJson(Map json) =>
_$SpotubeFullTrackObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
externalUri: json['externalUri'] as String,
@ -26,7 +25,6 @@ _$SpotubeFullTrackObjectImpl _$$SpotubeFullTrackObjectImplFromJson(Map json) =>
Map<String, dynamic> _$$SpotubeFullTrackObjectImplToJson(
_$SpotubeFullTrackObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'externalUri': instance.externalUri,
@ -40,7 +38,6 @@ Map<String, dynamic> _$$SpotubeFullTrackObjectImplToJson(
_$SpotubeLocalTrackObjectImpl _$$SpotubeLocalTrackObjectImplFromJson(
Map json) =>
_$SpotubeLocalTrackObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
externalUri: json['externalUri'] as String,
@ -57,7 +54,6 @@ _$SpotubeLocalTrackObjectImpl _$$SpotubeLocalTrackObjectImplFromJson(
Map<String, dynamic> _$$SpotubeLocalTrackObjectImplToJson(
_$SpotubeLocalTrackObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'externalUri': instance.externalUri,

View File

@ -15,7 +15,6 @@ part 'user.g.dart';
@freezed
sealed class SpotubeUserObject with _$SpotubeUserObject {
const factory SpotubeUserObject({
required String typeName,
required String id,
required String name,
required List<SpotubeImageObject> images,

View File

@ -20,7 +20,6 @@ SpotubeUserObject _$SpotubeUserObjectFromJson(Map<String, dynamic> json) {
/// @nodoc
mixin _$SpotubeUserObject {
String get typeName => throw _privateConstructorUsedError;
String get id => throw _privateConstructorUsedError;
String get name => throw _privateConstructorUsedError;
List<SpotubeImageObject> get images => throw _privateConstructorUsedError;
@ -43,8 +42,7 @@ abstract class $SpotubeUserObjectCopyWith<$Res> {
_$SpotubeUserObjectCopyWithImpl<$Res, SpotubeUserObject>;
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
List<SpotubeImageObject> images,
String externalUri});
@ -65,17 +63,12 @@ class _$SpotubeUserObjectCopyWithImpl<$Res, $Val extends SpotubeUserObject>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? images = null,
Object? externalUri = null,
}) {
return _then(_value.copyWith(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -105,8 +98,7 @@ abstract class _$$SpotubeUserObjectImplCopyWith<$Res>
@override
@useResult
$Res call(
{String typeName,
String id,
{String id,
String name,
List<SpotubeImageObject> images,
String externalUri});
@ -125,17 +117,12 @@ class __$$SpotubeUserObjectImplCopyWithImpl<$Res>
@pragma('vm:prefer-inline')
@override
$Res call({
Object? typeName = null,
Object? id = null,
Object? name = null,
Object? images = null,
Object? externalUri = null,
}) {
return _then(_$SpotubeUserObjectImpl(
typeName: null == typeName
? _value.typeName
: typeName // ignore: cast_nullable_to_non_nullable
as String,
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
@ -160,8 +147,7 @@ class __$$SpotubeUserObjectImplCopyWithImpl<$Res>
@JsonSerializable()
class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
const _$SpotubeUserObjectImpl(
{required this.typeName,
required this.id,
{required this.id,
required this.name,
required final List<SpotubeImageObject> images,
required this.externalUri})
@ -170,8 +156,6 @@ class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
factory _$SpotubeUserObjectImpl.fromJson(Map<String, dynamic> json) =>
_$$SpotubeUserObjectImplFromJson(json);
@override
final String typeName;
@override
final String id;
@override
@ -189,7 +173,7 @@ class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
@override
String toString() {
return 'SpotubeUserObject(typeName: $typeName, id: $id, name: $name, images: $images, externalUri: $externalUri)';
return 'SpotubeUserObject(id: $id, name: $name, images: $images, externalUri: $externalUri)';
}
@override
@ -197,8 +181,6 @@ class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SpotubeUserObjectImpl &&
(identical(other.typeName, typeName) ||
other.typeName == typeName) &&
(identical(other.id, id) || other.id == id) &&
(identical(other.name, name) || other.name == name) &&
const DeepCollectionEquality().equals(other._images, _images) &&
@ -208,7 +190,7 @@ class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, typeName, id, name,
int get hashCode => Object.hash(runtimeType, id, name,
const DeepCollectionEquality().hash(_images), externalUri);
/// Create a copy of SpotubeUserObject
@ -230,8 +212,7 @@ class _$SpotubeUserObjectImpl implements _SpotubeUserObject {
abstract class _SpotubeUserObject implements SpotubeUserObject {
const factory _SpotubeUserObject(
{required final String typeName,
required final String id,
{required final String id,
required final String name,
required final List<SpotubeImageObject> images,
required final String externalUri}) = _$SpotubeUserObjectImpl;
@ -239,8 +220,6 @@ abstract class _SpotubeUserObject implements SpotubeUserObject {
factory _SpotubeUserObject.fromJson(Map<String, dynamic> json) =
_$SpotubeUserObjectImpl.fromJson;
@override
String get typeName;
@override
String get id;
@override

View File

@ -8,7 +8,6 @@ part of 'user.dart';
_$SpotubeUserObjectImpl _$$SpotubeUserObjectImplFromJson(Map json) =>
_$SpotubeUserObjectImpl(
typeName: json['typeName'] as String,
id: json['id'] as String,
name: json['name'] as String,
images: (json['images'] as List<dynamic>)
@ -21,7 +20,6 @@ _$SpotubeUserObjectImpl _$$SpotubeUserObjectImplFromJson(Map json) =>
Map<String, dynamic> _$$SpotubeUserObjectImplToJson(
_$SpotubeUserObjectImpl instance) =>
<String, dynamic>{
'typeName': instance.typeName,
'id': instance.id,
'name': instance.name,
'images': instance.images.map((e) => e.toJson()).toList(),

View File

@ -3808,16 +3808,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
if (arr.length != 6)
throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
return SpotubeAudioSourceMatchObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
title: dco_decode_String(arr[2]),
artists: dco_decode_list_String(arr[3]),
duration: dco_decode_u_32(arr[4]),
thumbnail: dco_decode_opt_String(arr[5]),
externalUri: dco_decode_String(arr[6]),
id: dco_decode_String(arr[0]),
title: dco_decode_String(arr[1]),
artists: dco_decode_list_String(arr[2]),
duration: dco_decode_u_32(arr[3]),
thumbnail: dco_decode_opt_String(arr[4]),
externalUri: dco_decode_String(arr[5]),
);
}
@ -3845,16 +3844,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 6)
throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
if (arr.length != 5)
throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
return SpotubeBrowseSectionObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
title: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
browseMore: dco_decode_bool(arr[4]),
id: dco_decode_String(arr[0]),
title: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
browseMore: dco_decode_bool(arr[3]),
items:
dco_decode_list_spotube_browse_section_response_object_item(arr[5]),
dco_decode_list_spotube_browse_section_response_object_item(arr[4]),
);
}
@ -3900,20 +3898,19 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullAlbumObject dco_decode_spotube_full_album_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 11)
throw Exception('unexpected arr length: expect 11 but see ${arr.length}');
if (arr.length != 10)
throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
return SpotubeFullAlbumObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
artists: dco_decode_list_spotube_simple_artist_object(arr[3]),
images: dco_decode_list_spotube_image_object(arr[4]),
releaseDate: dco_decode_String(arr[5]),
externalUri: dco_decode_String(arr[6]),
totalTracks: dco_decode_i_32(arr[7]),
albumType: dco_decode_spotube_album_type(arr[8]),
recordLabel: dco_decode_opt_String(arr[9]),
genres: dco_decode_opt_list_String(arr[10]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
artists: dco_decode_list_spotube_simple_artist_object(arr[2]),
images: dco_decode_list_spotube_image_object(arr[3]),
releaseDate: dco_decode_String(arr[4]),
externalUri: dco_decode_String(arr[5]),
totalTracks: dco_decode_i_32(arr[6]),
albumType: dco_decode_spotube_album_type(arr[7]),
recordLabel: dco_decode_opt_String(arr[8]),
genres: dco_decode_opt_list_String(arr[9]),
);
}
@ -3921,16 +3918,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullArtistObject dco_decode_spotube_full_artist_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
if (arr.length != 6)
throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
return SpotubeFullArtistObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
images: dco_decode_list_spotube_image_object(arr[4]),
genres: dco_decode_opt_list_String(arr[5]),
followers: dco_decode_opt_box_autoadd_i_32(arr[6]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
images: dco_decode_list_spotube_image_object(arr[3]),
genres: dco_decode_opt_list_String(arr[4]),
followers: dco_decode_opt_box_autoadd_i_32(arr[5]),
);
}
@ -3939,19 +3935,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 10)
throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
if (arr.length != 9)
throw Exception('unexpected arr length: expect 9 but see ${arr.length}');
return SpotubeFullPlaylistObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
description: dco_decode_String(arr[3]),
externalUri: dco_decode_String(arr[4]),
owner: dco_decode_spotube_user_object(arr[5]),
images: dco_decode_list_spotube_image_object(arr[6]),
collaborators: dco_decode_list_spotube_user_object(arr[7]),
collaborative: dco_decode_bool(arr[8]),
public: dco_decode_bool(arr[9]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
description: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
owner: dco_decode_spotube_user_object(arr[4]),
images: dco_decode_list_spotube_image_object(arr[5]),
collaborators: dco_decode_list_spotube_user_object(arr[6]),
collaborative: dco_decode_bool(arr[7]),
public: dco_decode_bool(arr[8]),
);
}
@ -3959,18 +3954,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullTrackObject dco_decode_spotube_full_track_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 9)
throw Exception('unexpected arr length: expect 9 but see ${arr.length}');
if (arr.length != 8)
throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
return SpotubeFullTrackObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
artists: dco_decode_list_spotube_simple_artist_object(arr[4]),
album: dco_decode_spotube_simple_album_object(arr[5]),
durationMs: dco_decode_u_32(arr[6]),
isrc: dco_decode_String(arr[7]),
explicit: dco_decode_bool(arr[8]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
artists: dco_decode_list_spotube_simple_artist_object(arr[3]),
album: dco_decode_spotube_simple_album_object(arr[4]),
durationMs: dco_decode_u_32(arr[5]),
isrc: dco_decode_String(arr[6]),
explicit: dco_decode_bool(arr[7]),
);
}
@ -3978,13 +3972,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeImageObject dco_decode_spotube_image_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 4)
throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
if (arr.length != 3)
throw Exception('unexpected arr length: expect 3 but see ${arr.length}');
return SpotubeImageObject(
typeName: dco_decode_String(arr[0]),
url: dco_decode_String(arr[1]),
width: dco_decode_opt_box_autoadd_i_32(arr[2]),
height: dco_decode_opt_box_autoadd_i_32(arr[3]),
url: dco_decode_String(arr[0]),
width: dco_decode_opt_box_autoadd_i_32(arr[1]),
height: dco_decode_opt_box_autoadd_i_32(arr[2]),
);
}
@ -3992,17 +3985,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeLocalTrackObject dco_decode_spotube_local_track_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 8)
throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
return SpotubeLocalTrackObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
artists: dco_decode_list_spotube_simple_artist_object(arr[4]),
album: dco_decode_spotube_simple_album_object(arr[5]),
durationMs: dco_decode_u_32(arr[6]),
path: dco_decode_String(arr[7]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
artists: dco_decode_list_spotube_simple_artist_object(arr[3]),
album: dco_decode_spotube_simple_album_object(arr[4]),
durationMs: dco_decode_u_32(arr[5]),
path: dco_decode_String(arr[6]),
);
}
@ -4076,14 +4068,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 5)
throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
if (arr.length != 4)
throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
return SpotubeSearchResponseObject(
typeName: dco_decode_String(arr[0]),
albums: dco_decode_list_spotube_simple_album_object(arr[1]),
artists: dco_decode_list_spotube_full_artist_object(arr[2]),
playlists: dco_decode_list_spotube_simple_playlist_object(arr[3]),
tracks: dco_decode_list_spotube_full_track_object(arr[4]),
albums: dco_decode_list_spotube_simple_album_object(arr[0]),
artists: dco_decode_list_spotube_full_artist_object(arr[1]),
playlists: dco_decode_list_spotube_simple_playlist_object(arr[2]),
tracks: dco_decode_list_spotube_full_track_object(arr[3]),
);
}
@ -4091,17 +4082,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeSimpleAlbumObject dco_decode_spotube_simple_album_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 8)
throw Exception('unexpected arr length: expect 8 but see ${arr.length}');
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
return SpotubeSimpleAlbumObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
artists: dco_decode_list_spotube_simple_artist_object(arr[4]),
images: dco_decode_list_spotube_image_object(arr[5]),
albumType: dco_decode_spotube_album_type(arr[6]),
releaseDate: dco_decode_opt_String(arr[7]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
artists: dco_decode_list_spotube_simple_artist_object(arr[3]),
images: dco_decode_list_spotube_image_object(arr[4]),
albumType: dco_decode_spotube_album_type(arr[5]),
releaseDate: dco_decode_opt_String(arr[6]),
);
}
@ -4110,14 +4100,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 5)
throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
if (arr.length != 4)
throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
return SpotubeSimpleArtistObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
images: dco_decode_opt_list_spotube_image_object(arr[4]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
externalUri: dco_decode_String(arr[2]),
images: dco_decode_opt_list_spotube_image_object(arr[3]),
);
}
@ -4126,16 +4115,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 7)
throw Exception('unexpected arr length: expect 7 but see ${arr.length}');
if (arr.length != 6)
throw Exception('unexpected arr length: expect 6 but see ${arr.length}');
return SpotubeSimplePlaylistObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
description: dco_decode_String(arr[3]),
externalUri: dco_decode_String(arr[4]),
owner: dco_decode_spotube_user_object(arr[5]),
images: dco_decode_list_spotube_image_object(arr[6]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
description: dco_decode_String(arr[2]),
externalUri: dco_decode_String(arr[3]),
owner: dco_decode_spotube_user_object(arr[4]),
images: dco_decode_list_spotube_image_object(arr[5]),
);
}
@ -4160,14 +4148,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeUserObject dco_decode_spotube_user_object(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 5)
throw Exception('unexpected arr length: expect 5 but see ${arr.length}');
if (arr.length != 4)
throw Exception('unexpected arr length: expect 4 but see ${arr.length}');
return SpotubeUserObject(
typeName: dco_decode_String(arr[0]),
id: dco_decode_String(arr[1]),
name: dco_decode_String(arr[2]),
images: dco_decode_list_spotube_image_object(arr[3]),
externalUri: dco_decode_String(arr[4]),
id: dco_decode_String(arr[0]),
name: dco_decode_String(arr[1]),
images: dco_decode_list_spotube_image_object(arr[2]),
externalUri: dco_decode_String(arr[3]),
);
}
@ -5142,7 +5129,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeAudioSourceMatchObject sse_decode_spotube_audio_source_match_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_title = sse_decode_String(deserializer);
var var_artists = sse_decode_list_String(deserializer);
@ -5150,7 +5136,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_thumbnail = sse_decode_opt_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
return SpotubeAudioSourceMatchObject(
typeName: var_typeName,
id: var_id,
title: var_title,
artists: var_artists,
@ -5187,7 +5172,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeBrowseSectionObject sse_decode_spotube_browse_section_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_title = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
@ -5195,7 +5179,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_items = sse_decode_list_spotube_browse_section_response_object_item(
deserializer);
return SpotubeBrowseSectionObject(
typeName: var_typeName,
id: var_id,
title: var_title,
externalUri: var_externalUri,
@ -5249,7 +5232,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullAlbumObject sse_decode_spotube_full_album_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_artists =
@ -5262,7 +5244,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_recordLabel = sse_decode_opt_String(deserializer);
var var_genres = sse_decode_opt_list_String(deserializer);
return SpotubeFullAlbumObject(
typeName: var_typeName,
id: var_id,
name: var_name,
artists: var_artists,
@ -5279,7 +5260,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullArtistObject sse_decode_spotube_full_artist_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
@ -5287,7 +5267,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_genres = sse_decode_opt_list_String(deserializer);
var var_followers = sse_decode_opt_box_autoadd_i_32(deserializer);
return SpotubeFullArtistObject(
typeName: var_typeName,
id: var_id,
name: var_name,
externalUri: var_externalUri,
@ -5300,7 +5279,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullPlaylistObject sse_decode_spotube_full_playlist_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_description = sse_decode_String(deserializer);
@ -5311,7 +5289,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_collaborative = sse_decode_bool(deserializer);
var var_public = sse_decode_bool(deserializer);
return SpotubeFullPlaylistObject(
typeName: var_typeName,
id: var_id,
name: var_name,
description: var_description,
@ -5327,7 +5304,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeFullTrackObject sse_decode_spotube_full_track_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
@ -5338,7 +5314,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_isrc = sse_decode_String(deserializer);
var var_explicit = sse_decode_bool(deserializer);
return SpotubeFullTrackObject(
typeName: var_typeName,
id: var_id,
name: var_name,
externalUri: var_externalUri,
@ -5353,22 +5328,17 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeImageObject sse_decode_spotube_image_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_url = sse_decode_String(deserializer);
var var_width = sse_decode_opt_box_autoadd_i_32(deserializer);
var var_height = sse_decode_opt_box_autoadd_i_32(deserializer);
return SpotubeImageObject(
typeName: var_typeName,
url: var_url,
width: var_width,
height: var_height);
url: var_url, width: var_width, height: var_height);
}
@protected
SpotubeLocalTrackObject sse_decode_spotube_local_track_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
@ -5378,7 +5348,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_durationMs = sse_decode_u_32(deserializer);
var var_path = sse_decode_String(deserializer);
return SpotubeLocalTrackObject(
typeName: var_typeName,
id: var_id,
name: var_name,
externalUri: var_externalUri,
@ -5463,14 +5432,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeSearchResponseObject sse_decode_spotube_search_response_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_albums = sse_decode_list_spotube_simple_album_object(deserializer);
var var_artists = sse_decode_list_spotube_full_artist_object(deserializer);
var var_playlists =
sse_decode_list_spotube_simple_playlist_object(deserializer);
var var_tracks = sse_decode_list_spotube_full_track_object(deserializer);
return SpotubeSearchResponseObject(
typeName: var_typeName,
albums: var_albums,
artists: var_artists,
playlists: var_playlists,
@ -5481,7 +5448,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeSimpleAlbumObject sse_decode_spotube_simple_album_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
@ -5491,7 +5457,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_albumType = sse_decode_spotube_album_type(deserializer);
var var_releaseDate = sse_decode_opt_String(deserializer);
return SpotubeSimpleAlbumObject(
typeName: var_typeName,
id: var_id,
name: var_name,
externalUri: var_externalUri,
@ -5505,13 +5470,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeSimpleArtistObject sse_decode_spotube_simple_artist_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_externalUri = sse_decode_String(deserializer);
var var_images = sse_decode_opt_list_spotube_image_object(deserializer);
return SpotubeSimpleArtistObject(
typeName: var_typeName,
id: var_id,
name: var_name,
externalUri: var_externalUri,
@ -5522,7 +5485,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeSimplePlaylistObject sse_decode_spotube_simple_playlist_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_description = sse_decode_String(deserializer);
@ -5530,7 +5492,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
var var_owner = sse_decode_spotube_user_object(deserializer);
var var_images = sse_decode_list_spotube_image_object(deserializer);
return SpotubeSimplePlaylistObject(
typeName: var_typeName,
id: var_id,
name: var_name,
description: var_description,
@ -5563,13 +5524,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
SpotubeUserObject sse_decode_spotube_user_object(
SseDeserializer deserializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
var var_typeName = sse_decode_String(deserializer);
var var_id = sse_decode_String(deserializer);
var var_name = sse_decode_String(deserializer);
var var_images = sse_decode_list_spotube_image_object(deserializer);
var var_externalUri = sse_decode_String(deserializer);
return SpotubeUserObject(
typeName: var_typeName,
id: var_id,
name: var_name,
images: var_images,
@ -6445,7 +6404,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_audio_source_match_object(
SpotubeAudioSourceMatchObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.title, serializer);
sse_encode_list_String(self.artists, serializer);
@ -6472,7 +6430,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_browse_section_object(
SpotubeBrowseSectionObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.title, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6527,7 +6484,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_full_album_object(
SpotubeFullAlbumObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_list_spotube_simple_artist_object(self.artists, serializer);
@ -6544,7 +6500,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_full_artist_object(
SpotubeFullArtistObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6557,7 +6512,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_full_playlist_object(
SpotubeFullPlaylistObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.description, serializer);
@ -6573,7 +6527,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_full_track_object(
SpotubeFullTrackObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6588,7 +6541,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_image_object(
SpotubeImageObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.url, serializer);
sse_encode_opt_box_autoadd_i_32(self.width, serializer);
sse_encode_opt_box_autoadd_i_32(self.height, serializer);
@ -6598,7 +6550,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_local_track_object(
SpotubeLocalTrackObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6675,7 +6626,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_search_response_object(
SpotubeSearchResponseObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_list_spotube_simple_album_object(self.albums, serializer);
sse_encode_list_spotube_full_artist_object(self.artists, serializer);
sse_encode_list_spotube_simple_playlist_object(self.playlists, serializer);
@ -6686,7 +6636,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_simple_album_object(
SpotubeSimpleAlbumObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6700,7 +6649,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_simple_artist_object(
SpotubeSimpleArtistObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.externalUri, serializer);
@ -6711,7 +6659,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_simple_playlist_object(
SpotubeSimplePlaylistObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_String(self.description, serializer);
@ -6738,7 +6685,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
void sse_encode_spotube_user_object(
SpotubeUserObject self, SseSerializer serializer) {
// Codec=Sse (Serialization based), see doc to use other codecs
sse_encode_String(self.typeName, serializer);
sse_encode_String(self.id, serializer);
sse_encode_String(self.name, serializer);
sse_encode_list_spotube_image_object(self.images, serializer);

117
rust/Cargo.lock generated
View File

@ -556,9 +556,9 @@ dependencies = [
[[package]]
name = "curve25519-dalek"
version = "5.0.0-pre.2"
version = "5.0.0-pre.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d8cfa313d59919eda35b420bd37db85bf58d6754d6f128b9949932b0c0fcce7"
checksum = "92419e1cdc506051ffd30713ad09d0ec6a24bba9197e12989de389e35b19c77a"
dependencies = [
"cfg-if",
"cpufeatures",
@ -1324,7 +1324,6 @@ dependencies = [
"tokio",
"tokio-rustls 0.26.4",
"tower-service",
"webpki-roots",
]
[[package]]
@ -1590,6 +1589,16 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "junction"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c52f6e1bf39a7894f618c9d378904a11dbd7e10fe3ec20d1173600e79b1408d8"
dependencies = [
"scopeguard",
"windows-sys 0.60.2",
]
[[package]]
name = "lazy_static"
version = "1.5.0"
@ -1654,7 +1663,7 @@ checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
[[package]]
name = "llrt_abort"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_async_hooks",
"llrt_events",
@ -1667,7 +1676,7 @@ dependencies = [
[[package]]
name = "llrt_assert"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"rquickjs",
@ -1676,7 +1685,7 @@ dependencies = [
[[package]]
name = "llrt_async_hooks"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_hooking",
"llrt_utils",
@ -1687,7 +1696,7 @@ dependencies = [
[[package]]
name = "llrt_buffer"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_encoding",
@ -1699,7 +1708,7 @@ dependencies = [
[[package]]
name = "llrt_build"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"rustc_version",
]
@ -1707,7 +1716,7 @@ dependencies = [
[[package]]
name = "llrt_child_process"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"libc",
@ -1723,7 +1732,7 @@ dependencies = [
[[package]]
name = "llrt_compression"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"brotlic",
"flate2",
@ -1733,7 +1742,7 @@ dependencies = [
[[package]]
name = "llrt_console"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_logging",
"llrt_utils",
@ -1743,7 +1752,7 @@ dependencies = [
[[package]]
name = "llrt_context"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_build",
"llrt_utils",
@ -1755,7 +1764,7 @@ dependencies = [
[[package]]
name = "llrt_crypto"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"aes",
"aes-gcm",
@ -1787,10 +1796,25 @@ dependencies = [
"x25519-dalek",
]
[[package]]
name = "llrt_dgram"
version = "0.7.0-beta"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_buffer",
"llrt_context",
"llrt_events",
"llrt_utils",
"rquickjs",
"tokio",
"tracing",
]
[[package]]
name = "llrt_dns"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"either",
"llrt_context",
@ -1803,7 +1827,7 @@ dependencies = [
[[package]]
name = "llrt_dns_cache"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"hyper-util",
"llrt_context",
@ -1816,7 +1840,7 @@ dependencies = [
[[package]]
name = "llrt_encoding"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"base64-simd",
"hex-simd",
@ -1828,7 +1852,7 @@ dependencies = [
[[package]]
name = "llrt_events"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"rquickjs",
@ -1838,7 +1862,7 @@ dependencies = [
[[package]]
name = "llrt_exceptions"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"rquickjs",
@ -1847,7 +1871,7 @@ dependencies = [
[[package]]
name = "llrt_fetch"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"bytes",
"either",
@ -1861,6 +1885,7 @@ dependencies = [
"llrt_encoding",
"llrt_http",
"llrt_json",
"llrt_stream_web",
"llrt_url",
"llrt_utils",
"once_cell",
@ -1875,9 +1900,10 @@ dependencies = [
[[package]]
name = "llrt_fs"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"either",
"junction",
"llrt_buffer",
"llrt_encoding",
"llrt_path",
@ -1890,7 +1916,7 @@ dependencies = [
[[package]]
name = "llrt_hooking"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"once_cell",
@ -1900,7 +1926,7 @@ dependencies = [
[[package]]
name = "llrt_http"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"bytes",
"http-body-util",
@ -1918,7 +1944,7 @@ dependencies = [
[[package]]
name = "llrt_json"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_build",
@ -1931,7 +1957,7 @@ dependencies = [
[[package]]
name = "llrt_logging"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_context",
@ -1946,7 +1972,7 @@ dependencies = [
[[package]]
name = "llrt_modules"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"home",
"llrt_abort",
@ -1956,6 +1982,7 @@ dependencies = [
"llrt_child_process",
"llrt_console",
"llrt_crypto",
"llrt_dgram",
"llrt_dns",
"llrt_events",
"llrt_exceptions",
@ -1989,7 +2016,7 @@ dependencies = [
[[package]]
name = "llrt_navigator"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"rquickjs",
]
@ -1997,7 +2024,7 @@ dependencies = [
[[package]]
name = "llrt_net"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_buffer",
@ -2013,7 +2040,7 @@ dependencies = [
[[package]]
name = "llrt_numbers"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"itoa",
"llrt_utils",
@ -2024,7 +2051,7 @@ dependencies = [
[[package]]
name = "llrt_os"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"home",
"libc",
@ -2042,7 +2069,7 @@ dependencies = [
[[package]]
name = "llrt_path"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"memchr",
@ -2052,8 +2079,9 @@ dependencies = [
[[package]]
name = "llrt_perf_hooks"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_events",
"llrt_utils",
"rquickjs",
]
@ -2061,7 +2089,7 @@ dependencies = [
[[package]]
name = "llrt_process"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"libc",
"llrt_utils",
@ -2071,7 +2099,7 @@ dependencies = [
[[package]]
name = "llrt_stream"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_buffer",
"llrt_context",
@ -2084,7 +2112,7 @@ dependencies = [
[[package]]
name = "llrt_stream_web"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_abort",
"llrt_utils",
@ -2094,7 +2122,7 @@ dependencies = [
[[package]]
name = "llrt_string_decoder"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_buffer",
"llrt_encoding",
@ -2105,7 +2133,7 @@ dependencies = [
[[package]]
name = "llrt_timers"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_context",
"llrt_hooking",
@ -2118,17 +2146,18 @@ dependencies = [
[[package]]
name = "llrt_tls"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"once_cell",
"rustls 0.23.35",
"tracing",
"webpki-roots",
]
[[package]]
name = "llrt_tty"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"libc",
"llrt_utils",
@ -2138,7 +2167,7 @@ dependencies = [
[[package]]
name = "llrt_url"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_utils",
"rquickjs",
@ -2148,7 +2177,7 @@ dependencies = [
[[package]]
name = "llrt_util"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_context",
"llrt_encoding",
@ -2160,7 +2189,7 @@ dependencies = [
[[package]]
name = "llrt_utils"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"libc",
"llrt_build",
@ -2173,7 +2202,7 @@ dependencies = [
[[package]]
name = "llrt_zlib"
version = "0.7.0-beta"
source = "git+https://github.com/awslabs/llrt.git?rev=7d749dd18cf26a2e51119094c3b945975ae57bd4#7d749dd18cf26a2e51119094c3b945975ae57bd4"
source = "git+https://github.com/chessbyte/awslabs-llrt.git?branch=feat%2Ffetch-body-streams#6fe1e60d53b9ccaf5f17ba8f4463198e2061cb02"
dependencies = [
"llrt_buffer",
"llrt_compression",
@ -4179,9 +4208,9 @@ checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
[[package]]
name = "x25519-dalek"
version = "3.0.0-pre.2"
version = "3.0.0-pre.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a1de04376e841a39a324c95b2b099eb13b8b81d0c0a5adec29f322c205761d6"
checksum = "8367a41efe370c38fa4af81968298cdd695311791e4797118a1621f04ed75859"
dependencies = [
"curve25519-dalek",
"rand_core 0.10.0-rc-2",

View File

@ -18,7 +18,9 @@ serde = { version = "1.0.228", features = ["derive"] }
rquickjs = { version = "0", features = ["chrono", "futures", "macro", "classes", "bindgen"] }
tokio = { version = "1.48.0", features = ["full"] }
heck = "0.5.0"
llrt_modules = { git = "https://github.com/awslabs/llrt.git", rev = "7d749dd18cf26a2e51119094c3b945975ae57bd4", features = ["abort", "buffer", "console", "crypto", "events", "exceptions", "fetch", "navigator", "url", "timers"] }
# temporarily using a fork until PR is merged: https://github.com/awslabs/llrt/pull/1275
#llrt_modules = { git = "https://github.com/awslabs/llrt.git", rev = "7d749dd18cf26a2e51119094c3b945975ae57bd4", features = ["abort", "buffer", "console", "crypto", "events", "exceptions", "fetch", "navigator", "url", "stream-web", "timers"] }
llrt_modules = { git = "https://github.com/chessbyte/awslabs-llrt.git", branch = "feat/fetch-body-streams", features = ["abort", "buffer", "console", "crypto", "events", "exceptions", "fetch", "navigator", "url", "stream-web", "timers"] }
eventsource-client = "0.15.1"
reqwest = { version = "0.12", features = ["json"] }
confy = "2.0.0"

View File

@ -22,7 +22,7 @@ where
T: Debug,
{
tx.send(response)
.map_err(|e| anyhow::anyhow!("Failed to send response: {:?}", e))
.map_err(|e| anyhow::anyhow!("[send_response] Failed to send response: {:?}", e))
}
#[frb(ignore)]

View File

@ -4,6 +4,7 @@ use crate::api::plugin::models::artist::SpotubeSimpleArtistObject;
use crate::api::plugin::models::image::SpotubeImageObject;
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "lowercase")]
pub enum SpotubeAlbumType {
Album,
Single,
@ -14,7 +15,7 @@ pub enum SpotubeAlbumType {
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeSimpleAlbumObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub external_uri: String,
@ -29,7 +30,7 @@ pub struct SpotubeSimpleAlbumObject {
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeFullAlbumObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub artists: Vec<SpotubeSimpleArtistObject>,

View File

@ -6,7 +6,7 @@ use crate::api::plugin::models::image::SpotubeImageObject;
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeSimpleArtistObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub external_uri: String,
@ -17,7 +17,7 @@ pub struct SpotubeSimpleArtistObject {
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeFullArtistObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub external_uri: String,

View File

@ -85,7 +85,7 @@ impl SpotubeAudioSourceContainerPreset {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeAudioSourceMatchObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub title: String,
pub artists: Vec<String>,

View File

@ -9,7 +9,7 @@ use crate::api::plugin::models::track::{SpotubeFullTrackObject};
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"))]
pub struct SpotubeBrowseSectionObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub title: String,
pub external_uri: String,
@ -18,7 +18,7 @@ pub struct SpotubeBrowseSectionObject {
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase", tag = "type_name")]
#[serde(rename_all = "camelCase", tag = "typeName")]
pub enum SpotubeBrowseSectionResponseObjectItem {
#[serde(rename = "track")]
Track(SpotubeFullTrackObject),

View File

@ -3,8 +3,9 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
#[frb(dart_metadata=("freezed"),json_serializable)]
#[serde( rename_all = "camelCase")]
pub struct SpotubeImageObject {
pub type_name: String,
// pub type_name: String,
pub url: String,
pub width: Option<i32>,
pub height: Option<i32>,

View File

@ -18,7 +18,7 @@ pub struct SpotubePaginationResponseObject {
}
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase", tag = "type_name")]
#[serde(rename_all = "camelCase", tag = "typeName")]
pub enum SpotubePaginationResponseObjectItem {
#[serde(rename = "track")]
Track(SpotubeFullTrackObject),

View File

@ -7,7 +7,7 @@ use crate::api::plugin::models::user::SpotubeUserObject;
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeSimplePlaylistObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub description: String,
@ -21,7 +21,7 @@ pub struct SpotubeSimplePlaylistObject {
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeFullPlaylistObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub description: String,

View File

@ -9,7 +9,7 @@ use crate::api::plugin::models::track::SpotubeFullTrackObject;
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeSearchResponseObject {
pub type_name: String,
// pub type_name: String,
pub albums: Vec<SpotubeSimpleAlbumObject>,
pub artists: Vec<SpotubeFullArtistObject>,
pub playlists: Vec<SpotubeSimplePlaylistObject>,

View File

@ -7,7 +7,7 @@ use serde::{Deserialize, Serialize};
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeFullTrackObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub external_uri: String,
@ -23,7 +23,7 @@ pub struct SpotubeFullTrackObject {
#[serde(rename_all = "camelCase")]
#[frb(unignore,dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeLocalTrackObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
pub external_uri: String,

View File

@ -6,7 +6,7 @@ use crate::api::plugin::models::image::SpotubeImageObject;
#[serde(rename_all = "camelCase")]
#[frb(dart_metadata=("freezed"),json_serializable)]
pub struct SpotubeUserObject {
pub type_name: String,
// pub type_name: String,
pub id: String,
pub name: String,
#[serde(default)]

View File

@ -153,7 +153,7 @@ impl SpotubePlugin {
let mut receiver = self
.event_rx
.take()
.ok_or_else(|| anyhow::anyhow!("Receiver already consumed"))?;
.ok_or_else(|| anyhow::anyhow!("[SpotubePlugin][auth_state] Receiver already consumed"))?;
tokio::spawn(async move {
while let Some(event) = receiver.recv().await {
@ -200,7 +200,7 @@ impl SpotubePlugin {
let (ctx, _runtime) = ctx_res.unwrap();
let begin_injection = "globalThis.module = {exports: {}};";
let begin_injection = "console.log(globalThis);globalThis.module = {exports: {}};";
let end_injection = "globalThis.pluginInstance = new module.exports.default();";
let script = format!("{}\n{}\n{}", begin_injection, plugin_script, end_injection);

View File

@ -19,7 +19,6 @@ use crate::api::plugin::models::user::SpotubeUserObject;
use crate::api::plugin::plugin::OpaqueSender;
use anyhow::anyhow;
use flutter_rust_bridge::frb;
use std::backtrace::Backtrace;
use tokio::sync::oneshot;
#[derive(Debug, Clone, Copy)]
@ -43,9 +42,11 @@ impl PluginArtistSender {
id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][get_artist][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][get_artist][rx] {e}"))?
}
pub async fn top_tracks(
@ -64,9 +65,11 @@ impl PluginArtistSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][top_tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][top_tracks][rx] {e}"))?
}
pub async fn albums(
@ -85,9 +88,11 @@ impl PluginArtistSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][albums][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][albums][rx] {e}"))?
}
pub async fn related(
@ -106,9 +111,11 @@ impl PluginArtistSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][related][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][related][rx] {e}"))?
}
pub async fn save(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -119,9 +126,11 @@ impl PluginArtistSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][save][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][save][rx] {e}"))?
}
pub async fn unsave(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -132,9 +141,11 @@ impl PluginArtistSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginArtistSender][unsave][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginArtistSender][unsave][rx] {e}"))?
}
}
@ -159,9 +170,11 @@ impl PluginAlbumSender {
id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAlbumSender][get_album][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAlbumSender][get_album][rx] {e}"))?
}
pub async fn tracks(
@ -180,9 +193,11 @@ impl PluginAlbumSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAlbumSender][tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAlbumSender][tracks][rx] {e}"))?
}
pub async fn releases(
@ -199,9 +214,11 @@ impl PluginAlbumSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAlbumSender][releases][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAlbumSender][releases][rx] {e}"))?
}
pub async fn save(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -212,9 +229,11 @@ impl PluginAlbumSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAlbumSender][save][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAlbumSender][save][rx] {e}"))?
}
pub async fn unsave(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -225,9 +244,11 @@ impl PluginAlbumSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAlbumSender][unsave][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAlbumSender][unsave][rx] {e}"))?
}
}
@ -250,9 +271,11 @@ impl PluginAudioSourceSender {
.send(PluginCommand::AudioSource(
AudioSourceCommands::SupportedPresets { response_tx: tx },
))
.await?;
.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][supported_presets][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][supported_presets][rx] {e}"))?
}
pub async fn matches(
@ -267,9 +290,11 @@ impl PluginAudioSourceSender {
track,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][matches][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][matches][rx] {e}"))?
}
pub async fn streams(
@ -284,9 +309,11 @@ impl PluginAudioSourceSender {
matched,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][streams][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAudioSourceSender][streams][rx] {e}"))?
}
}
@ -306,9 +333,11 @@ impl PluginAuthSender {
.send(PluginCommand::Auth(AuthCommands::Authenticate {
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAuthSender][authenticate][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAuthSender][authenticate][rx] {e}"))?
}
pub async fn logout(&self, mpsc_tx: &OpaqueSender) -> anyhow::Result<()> {
@ -318,9 +347,11 @@ impl PluginAuthSender {
.send(PluginCommand::Auth(AuthCommands::Logout {
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAuthSender][logout][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAuthSender][logout][rx] {e}"))?
}
pub async fn is_authenticated(&self, mpsc_tx: &OpaqueSender) -> anyhow::Result<bool> {
@ -330,9 +361,11 @@ impl PluginAuthSender {
.send(PluginCommand::Auth(AuthCommands::IsAuthenticated {
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginAuthSender][is_authenticated][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginAuthSender][is_authenticated][rx] {e}"))?
}
}
@ -359,9 +392,11 @@ impl PluginBrowseSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginBrowseSender][sections][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginBrowseSender][sections][rx] {e}"))?
}
pub async fn section_items(
@ -380,9 +415,11 @@ impl PluginBrowseSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginBrowseSender][section_items][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginBrowseSender][section_items][rx] {e}"))?
}
}
@ -407,9 +444,11 @@ impl PluginCoreSender {
plugin_config,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginCoreSender][check_update][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginCoreSender][check_update][rx] {e}"))?
}
pub async fn support(&self, mpsc_tx: &OpaqueSender) -> anyhow::Result<String> {
@ -419,9 +458,11 @@ impl PluginCoreSender {
.send(PluginCommand::Core(CoreCommands::Support {
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginCoreSender][support][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginCoreSender][support][rx] {e}"))?
}
pub async fn scrobble(
@ -436,9 +477,11 @@ impl PluginCoreSender {
details,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginCoreSender][scrobble][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginCoreSender][scrobble][rx] {e}"))?
}
}
@ -463,9 +506,11 @@ impl PluginPlaylistSender {
id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][get_playlist][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][get_playlist][rx] {e}"))?
}
pub async fn tracks(
@ -484,9 +529,11 @@ impl PluginPlaylistSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][tracks][rx] {e}"))?
}
pub async fn create_playlist(
@ -509,9 +556,11 @@ impl PluginPlaylistSender {
collaborative,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][create_playlist][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][create_playlist][rx] {e}"))?
}
pub async fn update_playlist(
@ -534,9 +583,11 @@ impl PluginPlaylistSender {
collaborative,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][update_playlist][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][update_playlist][rx] {e}"))?
}
pub async fn delete_playlist(
@ -551,9 +602,11 @@ impl PluginPlaylistSender {
playlist_id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][delete_playlist][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][delete_playlist][rx] {e}"))?
}
pub async fn add_tracks(
@ -572,9 +625,11 @@ impl PluginPlaylistSender {
position,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][add_tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][add_tracks][rx] {e}"))?
}
pub async fn remove_tracks(
@ -591,9 +646,11 @@ impl PluginPlaylistSender {
track_ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][remove_tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][remove_tracks][rx] {e}"))?
}
pub async fn save(&self, mpsc_tx: &OpaqueSender, playlist_id: String) -> anyhow::Result<()> {
@ -604,9 +661,11 @@ impl PluginPlaylistSender {
playlist_id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][save][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][save][rx] {e}"))?
}
pub async fn unsave(&self, mpsc_tx: &OpaqueSender, playlist_id: String) -> anyhow::Result<()> {
@ -617,9 +676,11 @@ impl PluginPlaylistSender {
playlist_id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginPlaylistSender][unsave][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginPlaylistSender][unsave][rx] {e}"))?
}
}
@ -639,9 +700,11 @@ impl PluginSearchSender {
.send(PluginCommand::Search(SearchCommands::Chips {
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][chips][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][chips][rx] {e}"))?
}
pub async fn all(
@ -656,9 +719,11 @@ impl PluginSearchSender {
query,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][all][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][all][rx] {e}"))?
}
pub async fn tracks(
@ -677,9 +742,11 @@ impl PluginSearchSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][tracks][rx] {e}"))?
}
pub async fn albums(
@ -698,9 +765,11 @@ impl PluginSearchSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][albums][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][albums][rx] {e}"))?
}
pub async fn artists(
@ -719,9 +788,11 @@ impl PluginSearchSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][artists][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][artists][rx] {e}"))?
}
pub async fn playlists(
@ -740,9 +811,11 @@ impl PluginSearchSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginSearchSender][playlists][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginSearchSender][playlists][rx] {e}"))?
}
}
@ -767,9 +840,11 @@ impl PluginTrackSender {
id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginTrackSender][get_track][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginTrackSender][get_track][rx] {e}"))?
}
pub async fn save(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -780,9 +855,11 @@ impl PluginTrackSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginTrackSender][save][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginTrackSender][save][rx] {e}"))?
}
pub async fn unsave(&self, mpsc_tx: &OpaqueSender, ids: Vec<String>) -> anyhow::Result<()> {
@ -793,9 +870,11 @@ impl PluginTrackSender {
ids,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginTrackSender][unsave][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginTrackSender][unsave][rx] {e}"))?
}
pub async fn radio(
@ -810,9 +889,11 @@ impl PluginTrackSender {
id,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginTrackSender][radio][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginTrackSender][radio][rx] {e}"))?
}
}
@ -830,9 +911,11 @@ impl PluginUserSender {
mpsc_tx
.sender
.send(PluginCommand::User(UserCommands::Me { response_tx: tx }))
.await?;
.await
.map_err(|e| anyhow!("[PluginUserSender][me][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginUserSender][me][rx] {e}"))?
}
pub async fn saved_tracks(
@ -849,9 +932,11 @@ impl PluginUserSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginUserSender][saved_tracks][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginUserSender][saved_tracks][rx] {e}"))?
}
pub async fn saved_albums(
@ -868,9 +953,11 @@ impl PluginUserSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginUserSender][saved_albums][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginUserSender][saved_albums][rx] {e}"))?
}
pub async fn saved_artists(
@ -887,9 +974,11 @@ impl PluginUserSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginUserSender][saved_artists][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginUserSender][saved_artists][rx] {e}"))?
}
pub async fn saved_playlists(
@ -906,8 +995,10 @@ impl PluginUserSender {
limit,
response_tx: tx,
}))
.await?;
.await
.map_err(|e| anyhow!("[PluginUserSender][saved_playlists][mpsc_tx] {e}"))?;
rx.await.map_err(|e| anyhow!("{e}"))?
rx.await
.map_err(|e| anyhow!("[PluginUserSender][saved_playlists][rx] {e}"))?
}
}

View File

@ -5257,7 +5257,6 @@ impl SseDecode for crate::api::plugin::models::audio_source::SpotubeAudioSourceC
impl SseDecode for crate::api::plugin::models::audio_source::SpotubeAudioSourceMatchObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_title = <String>::sse_decode(deserializer);
let mut var_artists = <Vec<String>>::sse_decode(deserializer);
@ -5265,7 +5264,6 @@ impl SseDecode for crate::api::plugin::models::audio_source::SpotubeAudioSourceM
let mut var_thumbnail = <Option<String>>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
return crate::api::plugin::models::audio_source::SpotubeAudioSourceMatchObject {
type_name: var_typeName,
id: var_id,
title: var_title,
artists: var_artists,
@ -5306,7 +5304,6 @@ impl SseDecode for crate::api::plugin::models::audio_source::SpotubeAudioSourceS
impl SseDecode for crate::api::plugin::models::browse::SpotubeBrowseSectionObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_title = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5315,7 +5312,6 @@ impl SseDecode for crate::api::plugin::models::browse::SpotubeBrowseSectionObjec
crate::api::plugin::models::browse::SpotubeBrowseSectionResponseObjectItem,
>>::sse_decode(deserializer);
return crate::api::plugin::models::browse::SpotubeBrowseSectionObject {
type_name: var_typeName,
id: var_id,
title: var_title,
external_uri: var_externalUri,
@ -5389,7 +5385,6 @@ impl SseDecode for crate::api::plugin::models::browse::SpotubeBrowseSectionRespo
impl SseDecode for crate::api::plugin::models::album::SpotubeFullAlbumObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_artists =
@ -5406,7 +5401,6 @@ impl SseDecode for crate::api::plugin::models::album::SpotubeFullAlbumObject {
let mut var_recordLabel = <Option<String>>::sse_decode(deserializer);
let mut var_genres = <Option<Vec<String>>>::sse_decode(deserializer);
return crate::api::plugin::models::album::SpotubeFullAlbumObject {
type_name: var_typeName,
id: var_id,
name: var_name,
artists: var_artists,
@ -5424,7 +5418,6 @@ impl SseDecode for crate::api::plugin::models::album::SpotubeFullAlbumObject {
impl SseDecode for crate::api::plugin::models::artist::SpotubeFullArtistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5433,7 +5426,6 @@ impl SseDecode for crate::api::plugin::models::artist::SpotubeFullArtistObject {
let mut var_genres = <Option<Vec<String>>>::sse_decode(deserializer);
let mut var_followers = <Option<i32>>::sse_decode(deserializer);
return crate::api::plugin::models::artist::SpotubeFullArtistObject {
type_name: var_typeName,
id: var_id,
name: var_name,
external_uri: var_externalUri,
@ -5447,7 +5439,6 @@ impl SseDecode for crate::api::plugin::models::artist::SpotubeFullArtistObject {
impl SseDecode for crate::api::plugin::models::playlist::SpotubeFullPlaylistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_description = <String>::sse_decode(deserializer);
@ -5461,7 +5452,6 @@ impl SseDecode for crate::api::plugin::models::playlist::SpotubeFullPlaylistObje
let mut var_collaborative = <bool>::sse_decode(deserializer);
let mut var_public = <bool>::sse_decode(deserializer);
return crate::api::plugin::models::playlist::SpotubeFullPlaylistObject {
type_name: var_typeName,
id: var_id,
name: var_name,
description: var_description,
@ -5478,7 +5468,6 @@ impl SseDecode for crate::api::plugin::models::playlist::SpotubeFullPlaylistObje
impl SseDecode for crate::api::plugin::models::track::SpotubeFullTrackObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5492,7 +5481,6 @@ impl SseDecode for crate::api::plugin::models::track::SpotubeFullTrackObject {
let mut var_isrc = <String>::sse_decode(deserializer);
let mut var_explicit = <bool>::sse_decode(deserializer);
return crate::api::plugin::models::track::SpotubeFullTrackObject {
type_name: var_typeName,
id: var_id,
name: var_name,
external_uri: var_externalUri,
@ -5508,12 +5496,10 @@ impl SseDecode for crate::api::plugin::models::track::SpotubeFullTrackObject {
impl SseDecode for crate::api::plugin::models::image::SpotubeImageObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_url = <String>::sse_decode(deserializer);
let mut var_width = <Option<i32>>::sse_decode(deserializer);
let mut var_height = <Option<i32>>::sse_decode(deserializer);
return crate::api::plugin::models::image::SpotubeImageObject {
type_name: var_typeName,
url: var_url,
width: var_width,
height: var_height,
@ -5524,7 +5510,6 @@ impl SseDecode for crate::api::plugin::models::image::SpotubeImageObject {
impl SseDecode for crate::api::plugin::models::track::SpotubeLocalTrackObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5537,7 +5522,6 @@ impl SseDecode for crate::api::plugin::models::track::SpotubeLocalTrackObject {
let mut var_durationMs = <u32>::sse_decode(deserializer);
let mut var_path = <String>::sse_decode(deserializer);
return crate::api::plugin::models::track::SpotubeLocalTrackObject {
type_name: var_typeName,
id: var_id,
name: var_name,
external_uri: var_externalUri,
@ -5652,7 +5636,6 @@ impl SseDecode for crate::api::plugin::models::pagination::SpotubePaginationResp
impl SseDecode for crate::api::plugin::models::search::SpotubeSearchResponseObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_albums =
<Vec<crate::api::plugin::models::album::SpotubeSimpleAlbumObject>>::sse_decode(
deserializer,
@ -5669,7 +5652,6 @@ impl SseDecode for crate::api::plugin::models::search::SpotubeSearchResponseObje
deserializer,
);
return crate::api::plugin::models::search::SpotubeSearchResponseObject {
type_name: var_typeName,
albums: var_albums,
artists: var_artists,
playlists: var_playlists,
@ -5681,7 +5663,6 @@ impl SseDecode for crate::api::plugin::models::search::SpotubeSearchResponseObje
impl SseDecode for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5695,7 +5676,6 @@ impl SseDecode for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
<crate::api::plugin::models::album::SpotubeAlbumType>::sse_decode(deserializer);
let mut var_releaseDate = <Option<String>>::sse_decode(deserializer);
return crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
type_name: var_typeName,
id: var_id,
name: var_name,
external_uri: var_externalUri,
@ -5710,7 +5690,6 @@ impl SseDecode for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
impl SseDecode for crate::api::plugin::models::artist::SpotubeSimpleArtistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
@ -5719,7 +5698,6 @@ impl SseDecode for crate::api::plugin::models::artist::SpotubeSimpleArtistObject
deserializer,
);
return crate::api::plugin::models::artist::SpotubeSimpleArtistObject {
type_name: var_typeName,
id: var_id,
name: var_name,
external_uri: var_externalUri,
@ -5731,7 +5709,6 @@ impl SseDecode for crate::api::plugin::models::artist::SpotubeSimpleArtistObject
impl SseDecode for crate::api::plugin::models::playlist::SpotubeSimplePlaylistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_description = <String>::sse_decode(deserializer);
@ -5741,7 +5718,6 @@ impl SseDecode for crate::api::plugin::models::playlist::SpotubeSimplePlaylistOb
let mut var_images =
<Vec<crate::api::plugin::models::image::SpotubeImageObject>>::sse_decode(deserializer);
return crate::api::plugin::models::playlist::SpotubeSimplePlaylistObject {
type_name: var_typeName,
id: var_id,
name: var_name,
description: var_description,
@ -5781,14 +5757,12 @@ impl SseDecode for crate::api::plugin::models::track::SpotubeTrackObject {
impl SseDecode for crate::api::plugin::models::user::SpotubeUserObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
let mut var_typeName = <String>::sse_decode(deserializer);
let mut var_id = <String>::sse_decode(deserializer);
let mut var_name = <String>::sse_decode(deserializer);
let mut var_images =
<Vec<crate::api::plugin::models::image::SpotubeImageObject>>::sse_decode(deserializer);
let mut var_externalUri = <String>::sse_decode(deserializer);
return crate::api::plugin::models::user::SpotubeUserObject {
type_name: var_typeName,
id: var_id,
name: var_name,
images: var_images,
@ -6473,7 +6447,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.title.into_into_dart().into_dart(),
self.artists.into_into_dart().into_dart(),
@ -6538,7 +6511,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.title.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6602,7 +6574,6 @@ impl
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::album::SpotubeFullAlbumObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.artists.into_into_dart().into_dart(),
@ -6632,7 +6603,6 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::plugin::models::album::Spotub
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::artist::SpotubeFullArtistObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6660,7 +6630,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.description.into_into_dart().into_dart(),
@ -6691,7 +6660,6 @@ impl
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::track::SpotubeFullTrackObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6719,7 +6687,6 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::plugin::models::track::Spotub
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::image::SpotubeImageObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.url.into_into_dart().into_dart(),
self.width.into_into_dart().into_dart(),
self.height.into_into_dart().into_dart(),
@ -6742,7 +6709,6 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::plugin::models::image::Spotub
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::track::SpotubeLocalTrackObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6867,7 +6833,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.albums.into_into_dart().into_dart(),
self.artists.into_into_dart().into_dart(),
self.playlists.into_into_dart().into_dart(),
@ -6893,7 +6858,6 @@ impl
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6922,7 +6886,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.external_uri.into_into_dart().into_dart(),
@ -6949,7 +6912,6 @@ impl flutter_rust_bridge::IntoDart
{
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.description.into_into_dart().into_dart(),
@ -7004,7 +6966,6 @@ impl flutter_rust_bridge::IntoIntoDart<crate::api::plugin::models::track::Spotub
impl flutter_rust_bridge::IntoDart for crate::api::plugin::models::user::SpotubeUserObject {
fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
[
self.type_name.into_into_dart().into_dart(),
self.id.into_into_dart().into_dart(),
self.name.into_into_dart().into_dart(),
self.images.into_into_dart().into_dart(),
@ -7677,7 +7638,6 @@ crate::api::plugin::models::audio_source::SpotubeAudioSourceContainerPreset::Los
impl SseEncode for crate::api::plugin::models::audio_source::SpotubeAudioSourceMatchObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.title, serializer);
<Vec<String>>::sse_encode(self.artists, serializer);
@ -7707,7 +7667,6 @@ impl SseEncode for crate::api::plugin::models::audio_source::SpotubeAudioSourceS
impl SseEncode for crate::api::plugin::models::browse::SpotubeBrowseSectionObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.title, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7740,7 +7699,6 @@ crate::api::plugin::models::browse::SpotubeBrowseSectionResponseObjectItem::Arti
impl SseEncode for crate::api::plugin::models::album::SpotubeFullAlbumObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<Vec<crate::api::plugin::models::artist::SpotubeSimpleArtistObject>>::sse_encode(
@ -7766,7 +7724,6 @@ impl SseEncode for crate::api::plugin::models::album::SpotubeFullAlbumObject {
impl SseEncode for crate::api::plugin::models::artist::SpotubeFullArtistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7782,7 +7739,6 @@ impl SseEncode for crate::api::plugin::models::artist::SpotubeFullArtistObject {
impl SseEncode for crate::api::plugin::models::playlist::SpotubeFullPlaylistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.description, serializer);
@ -7804,7 +7760,6 @@ impl SseEncode for crate::api::plugin::models::playlist::SpotubeFullPlaylistObje
impl SseEncode for crate::api::plugin::models::track::SpotubeFullTrackObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7824,7 +7779,6 @@ impl SseEncode for crate::api::plugin::models::track::SpotubeFullTrackObject {
impl SseEncode for crate::api::plugin::models::image::SpotubeImageObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.url, serializer);
<Option<i32>>::sse_encode(self.width, serializer);
<Option<i32>>::sse_encode(self.height, serializer);
@ -7834,7 +7788,6 @@ impl SseEncode for crate::api::plugin::models::image::SpotubeImageObject {
impl SseEncode for crate::api::plugin::models::track::SpotubeLocalTrackObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7905,7 +7858,6 @@ crate::api::plugin::models::pagination::SpotubePaginationResponseObjectItem::Bro
impl SseEncode for crate::api::plugin::models::search::SpotubeSearchResponseObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<Vec<crate::api::plugin::models::album::SpotubeSimpleAlbumObject>>::sse_encode(
self.albums,
serializer,
@ -7928,7 +7880,6 @@ impl SseEncode for crate::api::plugin::models::search::SpotubeSearchResponseObje
impl SseEncode for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7951,7 +7902,6 @@ impl SseEncode for crate::api::plugin::models::album::SpotubeSimpleAlbumObject {
impl SseEncode for crate::api::plugin::models::artist::SpotubeSimpleArtistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.external_uri, serializer);
@ -7965,7 +7915,6 @@ impl SseEncode for crate::api::plugin::models::artist::SpotubeSimpleArtistObject
impl SseEncode for crate::api::plugin::models::playlist::SpotubeSimplePlaylistObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<String>::sse_encode(self.description, serializer);
@ -8004,7 +7953,6 @@ impl SseEncode for crate::api::plugin::models::track::SpotubeTrackObject {
impl SseEncode for crate::api::plugin::models::user::SpotubeUserObject {
// Codec=Sse (Serialization based), see doc to use other codecs
fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
<String>::sse_encode(self.type_name, serializer);
<String>::sse_encode(self.id, serializer);
<String>::sse_encode(self.name, serializer);
<Vec<crate::api::plugin::models::image::SpotubeImageObject>>::sse_encode(

View File

@ -56,8 +56,14 @@ pub fn js_value_to_json<'a>(value: rquickjs::Value<'a>, ctx: Ctx<'a>) -> anyhow:
return Ok(Value::Bool(b));
}
if let Some(n) = value.as_number() {
let num = serde_json::Number::from_f64(n).ok_or(anyhow!("Invalid number"))?;
if value.is_int() {
let num = serde_json::Number::from(value.as_int().unwrap_or(0));
return Ok(Value::Number(num));
}
if value.is_float() {
let num = serde_json::Number::from_f64(value.as_float().unwrap_or(0.0))
.ok_or(anyhow!("[js_value_to_json][as_number] Invalid number"))?;
return Ok(Value::Number(num));
}
@ -73,7 +79,7 @@ pub fn js_value_to_json<'a>(value: rquickjs::Value<'a>, ctx: Ctx<'a>) -> anyhow:
if obj.is_array() {
let obj: Array = Array::from_value(obj.into_value())
.catch(&ctx)
.map_err(|e| anyhow!("{}", e))?;
.map_err(|e| anyhow!("[js_value_to_json][Array::from_value] {e}"))?;
let length = obj.len();
let mut json_arr = Vec::<Value>::with_capacity(length);
@ -113,57 +119,68 @@ pub async fn js_invoke_async_method_to_json<'b, T, R>(
args: &[T],
) -> anyhow::Result<Option<R>>
where
T: Serialize,
T: Serialize + Debug,
R: DeserializeOwned + Debug,
{
let global = ctx.globals();
let plugin_instance: Object<'b> = global
.get("pluginInstance")
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_async_method_to_json][global.pluginInstance] {e}"))?;
let core_val: Object<'b> = plugin_instance
.get(endpoint_name)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
let js_fn: Function<'b> = core_val.get(name).catch(&ctx).map_err(|e| anyhow!("{e}"))?;
.map_err(|e| {
anyhow!("[js_invoke_async_method_to_json][global.pluginInstance.{endpoint_name}] {e}")
})?;
let js_fn: Function<'b> = core_val.get(name).catch(&ctx).map_err(|e| {
anyhow!(
"[js_invoke_async_method_to_json][global.pluginInstance.{endpoint_name}.{name}()] {e}"
)
})?;
let mut args_js = Args::new(ctx.clone(), args.len() as usize);
args_js
.this(core_val)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_async_method_to_json][global.pluginInstance.{endpoint_name}.{name}.args.this] {e}"))?;
for arg in args.iter() {
let arg_value = serde_json::to_value(arg).map_err(|e| anyhow!("{e}"))?;
let arg_value = serde_json::to_value(arg).map_err(|e| {
anyhow!("[js_invoke_async_method_to_json][global.pluginInstance.{endpoint_name}.{name}.args.{:?}] {e}", arg)
})?;
let arg_js = json_value_to_js(&arg_value, ctx.clone())
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_async_method_to_json][json_value_to_js] {e}"))?;
args_js
.push_arg(arg_js)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_async_method_to_json][Args::push_arg] {e}"))?;
}
let result_promise: Promise = js_fn
.call_arg(args_js)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
let result_promise: Promise = js_fn.call_arg(args_js).catch(&ctx).map_err(|e| {
anyhow!(
"[js_invoke_async_method_to_json][pluginInstance.{endpoint_name}.{name}() result] {e}"
)
})?;
println!("Sync Result: {:?}", result_promise);
let result_future: rquickjs::Value = result_promise
.into_future()
.await
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_async_method_to_json][pluginInstance.{endpoint_name}.{name}() future]{e}"))?;
let value = js_value_to_json(result_future, ctx.clone())?;
if value.is_null() {
return Ok(None);
}
Ok(Some(
serde_json::from_value::<R>(value).map_err(|e| anyhow!("{e}"))?,
))
Ok(Some(serde_json::from_value::<R>(value).map_err(|e| {
anyhow!(
"[js_invoke_async_method_to_json][pluginInstance.{endpoint_name}.{name}() toJson] {e}"
)
})?))
}
pub fn js_invoke_method_to_json<'b, T, R>(
@ -173,48 +190,48 @@ pub fn js_invoke_method_to_json<'b, T, R>(
args: &[T],
) -> anyhow::Result<Option<R>>
where
T: Serialize,
T: Serialize + Debug,
R: DeserializeOwned,
{
let global = ctx.globals();
let plugin_instance: Object<'b> = global
.get("pluginInstance")
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_method_to_json][pluginInstance] {e}"))?;
let core_val: Object<'b> = plugin_instance
.get(endpoint_name)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
let js_fn: Function<'b> = core_val.get(name).catch(&ctx).map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}] {e}"))?;
let js_fn: Function<'b> = core_val.get(name).catch(&ctx).map_err(|e| {
anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}.{name}] {e}")
})?;
let mut args_js = Args::new(ctx.clone(), args.len() as usize);
args_js
.this(core_val)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
args_js.this(core_val).catch(&ctx).map_err(|e| {
anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}.{name}.args.this] {e}")
})?;
for arg in args.iter().enumerate() {
for arg in args.iter() {
let arg_value = serde_json::to_value(arg).map_err(|e| anyhow!("{e}"))?;
let arg_js = json_value_to_js(&arg_value, ctx.clone())
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}.{name}.args.{:?}] {e}", arg))?;
args_js
.push_arg(arg_js)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
.map_err(|e| anyhow!("[js_invoke_method_to_json][Args::push_arg] {e}"))?;
}
let result: rquickjs::Value = js_fn
.call_arg(args_js)
.catch(&ctx)
.map_err(|e| anyhow!("{e}"))?;
let result: rquickjs::Value = js_fn.call_arg(args_js).catch(&ctx).map_err(|e| {
anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}.{name}() result] {e}")
})?;
let value = js_value_to_json(result, ctx.clone())?;
if value.is_null() {
return Ok(None);
}
Ok(Some(
serde_json::from_value::<R>(value).map_err(|e| anyhow!("{e}"))?,
))
Ok(Some(serde_json::from_value::<R>(value).map_err(|e| {
anyhow!("[js_invoke_method_to_json][pluginInstance.{endpoint_name}.{name}() toJson] {e}")
})?))
}