9c504d2c3d
Features: - Frontend Flutter avec thème néon cyberpunk - Backend FastAPI avec streaming YouTube - Base de données PostgreSQL + Redis - Authentification JWT complète - Recherche multi-source (DB + YouTube) - Playlists CRUD avec drag & drop - Queue management - Settings avec audio quality - Interface adaptative (Desktop + Mobile) Tech Stack: - Frontend: Flutter 3.2+, Riverpod - Backend: Python 3.11+, FastAPI - Database: PostgreSQL 15+ - Cache: Redis 7+ - Streaming: yt-dlp + FFmpeg 🚀 Generated with Claude Code Co-Authored-By: Claude <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];
|
|
}
|