fix: bad env
This commit is contained in:
11
.env.example
11
.env.example
@@ -1,11 +1,3 @@
|
||||
# API Configuration
|
||||
NEXT_PUBLIC_API_URL=http://localhost:3000
|
||||
NEXT_PUBLIC_KOMGA_URL=http://localhost:8080
|
||||
|
||||
# Authentication
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
NEXTAUTH_SECRET=your-secret-key-here
|
||||
|
||||
# Database
|
||||
MONGODB_URI=mongodb://localhost:27017/stripstream
|
||||
|
||||
@@ -13,6 +5,3 @@ MONGODB_URI=mongodb://localhost:27017/stripstream
|
||||
MONGO_USER=admin
|
||||
MONGO_PASSWORD=password
|
||||
MONGODB_URI=mongodb://admin:password@localhost:27017/stripstream?authSource=admin
|
||||
|
||||
# Komga
|
||||
NEXT_PUBLIC_API_URL=https://cloud.julienfroidefond.com
|
||||
@@ -36,10 +36,6 @@ npm install
|
||||
|
||||
3. Créer un fichier `.env.local` à la racine du projet
|
||||
|
||||
```bash
|
||||
NEXT_PUBLIC_API_URL=https://cloud.julienfroidefond.com
|
||||
```
|
||||
|
||||
4. Lancer le serveur de développement
|
||||
|
||||
```bash
|
||||
|
||||
@@ -14,7 +14,6 @@ services:
|
||||
- /app/.next
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- NEXT_PUBLIC_API_URL= ${NEXT_PUBLIC_API_URL}
|
||||
command: npm run dev
|
||||
|
||||
mongodb:
|
||||
|
||||
@@ -1,25 +1,16 @@
|
||||
import { FavoriteService } from "@/lib/services/favorite.service";
|
||||
import { LibraryService } from "@/lib/services/library.service";
|
||||
import { SeriesService } from "@/lib/services/series.service";
|
||||
|
||||
export async function SidebarWrapper() {
|
||||
// Récupérer les favoris depuis le serveur
|
||||
const favoriteIds = await FavoriteService.getAllFavoriteIds();
|
||||
|
||||
// Récupérer les détails des séries favorites
|
||||
const favoritesPromises = favoriteIds.map(async (id) => {
|
||||
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/v1/series/${id}`, {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
},
|
||||
});
|
||||
if (!response.ok) return null;
|
||||
return response.json();
|
||||
});
|
||||
const favorites = await SeriesService.getMultipleSeries(favoriteIds);
|
||||
|
||||
// Récupérer les bibliothèques
|
||||
const libraries = await LibraryService.getLibraries();
|
||||
|
||||
const favorites = (await Promise.all(favoritesPromises)).filter(Boolean);
|
||||
|
||||
return { favorites, libraries };
|
||||
}
|
||||
|
||||
@@ -105,4 +105,14 @@ export class SeriesService extends BaseApiService {
|
||||
static getCoverUrl(seriesId: string): string {
|
||||
return `/api/komga/images/series/${seriesId}/thumbnail`;
|
||||
}
|
||||
|
||||
static async getMultipleSeries(seriesIds: string[]): Promise<KomgaSeries[]> {
|
||||
try {
|
||||
const seriesPromises = seriesIds.map((id) => this.getSeries(id));
|
||||
const series = await Promise.all(seriesPromises);
|
||||
return series.filter(Boolean);
|
||||
} catch (error) {
|
||||
return this.handleError(error, "Impossible de récupérer les séries");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user