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>
64 lines
1.8 KiB
Dart
64 lines
1.8 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
import 'artist.dart';
|
|
|
|
/// Album entity
|
|
class Album extends Equatable {
|
|
final String id;
|
|
final String title;
|
|
final DateTime? releaseDate;
|
|
final String? imageUrl;
|
|
final int totalTracks;
|
|
final String? genre;
|
|
final String? artistId;
|
|
final Artist? artist;
|
|
final String? spotifyId;
|
|
final String? youtubePlaylistId;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
|
|
const Album({
|
|
required this.id,
|
|
required this.title,
|
|
this.releaseDate,
|
|
this.imageUrl,
|
|
this.totalTracks = 0,
|
|
this.genre,
|
|
this.artistId,
|
|
this.artist,
|
|
this.spotifyId,
|
|
this.youtubePlaylistId,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
|
|
/// Create Album from JSON
|
|
factory Album.fromJson(Map<String, dynamic> json) {
|
|
return Album(
|
|
id: json['id'] as String,
|
|
title: json['title'] as String,
|
|
releaseDate: json['release_date'] != null
|
|
? DateTime.parse(json['release_date'] as String)
|
|
: null,
|
|
imageUrl: json['image_url'] as String?,
|
|
totalTracks: json['total_tracks'] as int? ?? 0,
|
|
genre: json['genre'] as String?,
|
|
artistId: json['artist_id'] as String?,
|
|
artist: json['artist'] != null
|
|
? Artist.fromJson(json['artist'] as Map<String, dynamic>)
|
|
: null,
|
|
spotifyId: json['spotify_id'] as String?,
|
|
youtubePlaylistId: json['youtube_playlist_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, title, releaseDate, totalTracks];
|
|
}
|