- Lot G: Recherche avancée (musical_key, tri pertinence, autocomplete, facettes, historique) - Lot H: Analytics créateur (stats, charts, completion rate, export CSV/JSON) - Lot F: Seller dashboard (GET /sell/stats, liste produits) - Lot C: Player (crossfade, gapless preload, PiP) - Lot D2: Autoplay (GET /tracks/recommendations, section À écouter ensuite) Backend: GetRecommendations handler, route /tracks/recommendations Frontend: PlayerQueue recommendations, fix TS errors (GlobalPlayer, AnalyticsViewKpiGrid, etc.) Docs: FEATURE_STATUS, PROJECT_STATE, CHANGELOG, SCOPE_CONTROL
155 lines
2.6 KiB
TypeScript
155 lines
2.6 KiB
TypeScript
/**
|
|
* Tracks API Service
|
|
* Action 6.1.1.1: Create tracks API service
|
|
* Service layer for track-related API operations
|
|
* Wraps existing track API functions into a unified service object
|
|
*/
|
|
|
|
import {
|
|
uploadTrack,
|
|
getTracks,
|
|
getTrackRecommendations,
|
|
updateTrack,
|
|
getTrackStats,
|
|
getTrackHistory,
|
|
downloadTrack,
|
|
likeTrack,
|
|
unlikeTrack,
|
|
deleteTrack,
|
|
getTrackLikes,
|
|
createTrackShare,
|
|
initiateChunkedUpload,
|
|
uploadChunk,
|
|
completeChunkedUpload,
|
|
batchDeleteTracks,
|
|
batchUpdateTracks,
|
|
type TrackMetadata,
|
|
type UpdateTrackRequest,
|
|
type TrackStats,
|
|
type TrackHistory,
|
|
type CreateShareRequest,
|
|
type Share,
|
|
type TrackLikesResponse,
|
|
type GetTracksParams,
|
|
type GetTracksResponse,
|
|
type BatchDeleteRequest,
|
|
type BatchDeleteResponse,
|
|
type BatchUpdateRequest,
|
|
type BatchUpdateResponse,
|
|
} from '@/features/tracks/api/trackApi';
|
|
import { getTrack } from '@/features/tracks/services/trackService';
|
|
import type { Track } from '@/features/tracks/types/track';
|
|
|
|
/**
|
|
* Tracks API Service Object
|
|
* Action 6.1.1.1: Exports unified tracksApi object with all track operations
|
|
*/
|
|
export const tracksApi = {
|
|
/**
|
|
* List tracks with pagination and filters
|
|
*/
|
|
list: getTracks,
|
|
|
|
/**
|
|
* Get a single track by ID
|
|
*/
|
|
get: getTrack,
|
|
|
|
/**
|
|
* Get personalized track recommendations (D2 autoplay)
|
|
*/
|
|
getRecommendations: getTrackRecommendations,
|
|
|
|
/**
|
|
* Create/upload a new track
|
|
*/
|
|
create: uploadTrack,
|
|
|
|
/**
|
|
* Update track metadata
|
|
*/
|
|
update: updateTrack,
|
|
|
|
/**
|
|
* Delete a track
|
|
*/
|
|
delete: deleteTrack,
|
|
|
|
/**
|
|
* Get track statistics
|
|
*/
|
|
getStats: getTrackStats,
|
|
|
|
/**
|
|
* Get track history
|
|
*/
|
|
getHistory: getTrackHistory,
|
|
|
|
/**
|
|
* Download a track
|
|
*/
|
|
download: downloadTrack,
|
|
|
|
/**
|
|
* Like a track
|
|
*/
|
|
like: likeTrack,
|
|
|
|
/**
|
|
* Unlike a track
|
|
*/
|
|
unlike: unlikeTrack,
|
|
|
|
/**
|
|
* Get track likes information
|
|
*/
|
|
getLikes: getTrackLikes,
|
|
|
|
/**
|
|
* Create a share link for a track
|
|
*/
|
|
createShare: createTrackShare,
|
|
|
|
/**
|
|
* Initiate chunked upload
|
|
*/
|
|
initiateChunkedUpload,
|
|
|
|
/**
|
|
* Upload a chunk
|
|
*/
|
|
uploadChunk,
|
|
|
|
/**
|
|
* Complete chunked upload
|
|
*/
|
|
completeChunkedUpload,
|
|
|
|
/**
|
|
* Batch delete tracks
|
|
*/
|
|
batchDelete: batchDeleteTracks,
|
|
|
|
/**
|
|
* Batch update tracks
|
|
*/
|
|
batchUpdate: batchUpdateTracks,
|
|
};
|
|
|
|
// Re-export types for convenience
|
|
export type {
|
|
Track,
|
|
TrackMetadata,
|
|
UpdateTrackRequest,
|
|
TrackStats,
|
|
TrackHistory,
|
|
CreateShareRequest,
|
|
Share,
|
|
TrackLikesResponse,
|
|
GetTracksParams,
|
|
GetTracksResponse,
|
|
BatchDeleteRequest,
|
|
BatchDeleteResponse,
|
|
BatchUpdateRequest,
|
|
BatchUpdateResponse,
|
|
};
|