38 lines
763 B
Dart
38 lines
763 B
Dart
|
import 'package:json_annotation/json_annotation.dart';
|
||
|
part 'artist.g.dart';
|
||
|
|
||
|
@JsonSerializable()
|
||
|
|
||
|
/// Artist object from the Subsonic API
|
||
|
class Artist {
|
||
|
/// Artist object from the Subsonic API
|
||
|
const Artist(
|
||
|
this.id,
|
||
|
this.name,
|
||
|
this.albumCount,
|
||
|
this.coverArtId,
|
||
|
this.artistImageUrl,
|
||
|
);
|
||
|
|
||
|
/// Creates instance from the JSON response
|
||
|
factory Artist.fromJson(Map<String, dynamic> json) => _$ArtistFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> toJson() => _$ArtistToJson(this);
|
||
|
|
||
|
/// ID of the artist
|
||
|
final String id;
|
||
|
|
||
|
/// Artist's name
|
||
|
final String name;
|
||
|
|
||
|
/// Number of albums
|
||
|
final int albumCount;
|
||
|
|
||
|
/// Cover art ID
|
||
|
@JsonKey(name: "coverArt")
|
||
|
final String coverArtId;
|
||
|
|
||
|
/// Artist image URL
|
||
|
final String artistImageUrl;
|
||
|
}
|