// Barrel re-export for the library-related services. The previous version of this
// file pointed at `/library/*` paths, but the backend registers library routes at
// the `/api` root (see backend/src/app.ts). Use the per-entity services instead.
import api from './api';

export interface LibraryStats {
  tracks: number;
  albums: number;
  artists: number;
  /** Total playtime in seconds. */
  duration: number;
}

// GET /api/library/stats
export async function fetchLibraryStats(): Promise<LibraryStats> {
  const res = await api.get<LibraryStats>('/library/stats');
  return res.data;
}

export { trackService } from './trackService';
export { artistService } from './artistService';
export { albumService } from './albumService';
export { favoritesService } from './favoritesService';
export type { Track, Artist, Album } from '../types';
