28 lines
773 B
Dart
28 lines
773 B
Dart
|
import 'package:json_annotation/json_annotation.dart';
|
||
|
import 'package:ocarina/api/subsonic/artist.dart';
|
||
|
part 'artistindex.g.dart';
|
||
|
|
||
|
/// List of artist under a certain index (first letter of their name)
|
||
|
///
|
||
|
/// As returned by `getIndexes`
|
||
|
@JsonSerializable()
|
||
|
class ArtistIndex {
|
||
|
/// Creates instance from the JSON response returned by `getIndexes`
|
||
|
factory ArtistIndex.fromJson(Map<String, dynamic> json) =>
|
||
|
_$ArtistIndexFromJson(json);
|
||
|
|
||
|
ArtistIndex({required this.index, required this.artists});
|
||
|
|
||
|
Map<String, dynamic> toJson() => _$ArtistIndexToJson(this);
|
||
|
|
||
|
/// The index
|
||
|
///
|
||
|
/// `#` for unknown character
|
||
|
@JsonKey(name: "name")
|
||
|
final String index;
|
||
|
|
||
|
/// List of artists under this index
|
||
|
@JsonKey(name: "artist")
|
||
|
final List<Artist> artists;
|
||
|
}
|