a89c7894cf
Backend: - FastAPI avec PostgreSQL et Redis - Authentification JWT complète - API REST pour musique, playlists, recherche - Streaming audio via yt-dlp - SQLAlchemy 2.0 async Frontend: - Flutter avec thème néon cyberpunk - State management Riverpod - Layout adaptatif desktop/mobile - Lecteur audio avec mini-player Infrastructure: - Docker Compose (PostgreSQL + Redis) - Scripts d'installation automatisés - Scripts de build pour exécutables Fichiers ajoutés: - BUILD_CLIENT_*.bat/sh: Scripts de compilation - BUILD_CLIENT_README.md: Documentation compilation - CHECK_FLUTTER.sh: Vérificateur d'environnement - requirements.txt mis à jour pour Python 3.13 - Modèles SQLAlchemy corrigés (metadata -> extra_metadata) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
55 lines
1.4 KiB
Dart
55 lines
1.4 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
/// Artist entity
|
|
class Artist extends Equatable {
|
|
final String id;
|
|
final String name;
|
|
final String? imageUrl;
|
|
final String? bio;
|
|
final List<String> genres;
|
|
final int popularity;
|
|
final String? spotifyId;
|
|
final String? youtubeId;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
|
|
const Artist({
|
|
required this.id,
|
|
required this.name,
|
|
this.imageUrl,
|
|
this.bio,
|
|
this.genres = const [],
|
|
this.popularity = 0,
|
|
this.spotifyId,
|
|
this.youtubeId,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
|
|
/// Create Artist from JSON
|
|
factory Artist.fromJson(Map<String, dynamic> json) {
|
|
return Artist(
|
|
id: json['id'] as String,
|
|
name: json['name'] as String,
|
|
imageUrl: json['image_url'] as String?,
|
|
bio: json['bio'] as String?,
|
|
genres: (json['genres'] as List<dynamic>?)
|
|
?.map((e) => e as String)
|
|
.toList() ??
|
|
[],
|
|
popularity: json['popularity'] as int? ?? 0,
|
|
spotifyId: json['spotify_id'] as String?,
|
|
youtubeId: json['youtube_id'] as String?,
|
|
createdAt: json['created_at'] != null
|
|
? DateTime.parse(json['created_at'] as String)
|
|
: DateTime.now(),
|
|
updatedAt: json['updated_at'] != null
|
|
? DateTime.parse(json['updated_at'] as String)
|
|
: DateTime.now(),
|
|
);
|
|
}
|
|
|
|
@override
|
|
List<Object?> get props => [id, name, genres, popularity];
|
|
}
|