- DB: album_teasers 테이블에 video_url 컬럼 추가 - 백엔드: 비디오 업로드 시 ffmpeg로 썸네일 추출 후 WebP 저장 - 백엔드: video_url에 MP4 URL 저장, 썸네일은 기존 URL 필드 사용 - 프론트엔드: 썸네일 이미지 표시, 클릭 시 video_url로 재생 - Flutter 앱: Teaser 모델에 videoUrl 필드 추가 및 비디오 재생 수정 - Docker: ffmpeg 설치 추가 (Dockerfile, docker-compose.dev.yml) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
32 lines
1 KiB
Dart
32 lines
1 KiB
Dart
/// 앨범 API 서비스
|
|
library;
|
|
|
|
import '../models/album.dart';
|
|
import 'api_client.dart';
|
|
|
|
/// 앨범 목록 조회
|
|
Future<List<Album>> getAlbums() async {
|
|
final response = await dio.get('/albums');
|
|
final List<dynamic> data = response.data;
|
|
return data.map((json) => Album.fromJson(json)).toList();
|
|
}
|
|
|
|
/// 최신 앨범 N개 조회
|
|
Future<List<Album>> getRecentAlbums(int count) async {
|
|
final albums = await getAlbums();
|
|
return albums.take(count).toList();
|
|
}
|
|
|
|
/// 앨범 상세 조회 (폴더명으로)
|
|
Future<Album> getAlbumByName(String name) async {
|
|
final response = await dio.get('/albums/by-name/$name');
|
|
return Album.fromJson(response.data);
|
|
}
|
|
|
|
/// 트랙 상세 조회 (앨범명, 트랙명으로)
|
|
Future<TrackDetail> getTrack(String albumName, String trackTitle) async {
|
|
final encodedAlbum = Uri.encodeComponent(albumName);
|
|
final encodedTrack = Uri.encodeComponent(trackTitle);
|
|
final response = await dio.get('/albums/by-name/$encodedAlbum/track/$encodedTrack');
|
|
return TrackDetail.fromJson(response.data);
|
|
}
|