diff --git a/app/curator/CuratorPageClient.tsx b/app/curator/CuratorPageClient.tsx index fd648a5..aef0fc4 100644 --- a/app/curator/CuratorPageClient.tsx +++ b/app/curator/CuratorPageClient.tsx @@ -107,6 +107,7 @@ export default function CuratorPageClient() { // Upload state (analog zum Admin-Upload, aber vereinfacht) const [files, setFiles] = useState([]); const [uploadGenreIds, setUploadGenreIds] = useState([]); + const [uploadSpecialIds, setUploadSpecialIds] = useState([]); const [isUploading, setIsUploading] = useState(false); const [isDragging, setIsDragging] = useState(false); const [uploadProgress, setUploadProgress] = useState<{ current: number; total: number }>({ @@ -534,6 +535,18 @@ export default function CuratorPageClient() { ); }; + const toggleUploadSpecial = (specialId: number) => { + setUploadSpecialIds(prev => + prev.includes(specialId) ? prev.filter(id => id !== specialId) : [...prev, specialId] + ); + }; + +const toggleUploadSpecial = (specialId: number) => { + setUploadSpecialIds(prev => + prev.includes(specialId) ? prev.filter(id => id !== specialId) : [...prev, specialId] + ); +}; + const handleFileChange = (e: React.ChangeEvent) => { const selected = Array.from(e.target.files || []); if (selected.length === 0) return; @@ -636,8 +649,8 @@ export default function CuratorPageClient() { setFiles([]); setIsUploading(false); - // Genres den erfolgreich hochgeladenen Songs zuweisen - if (uploadGenreIds.length > 0) { + // Genres/Specials den erfolgreich hochgeladenen Songs zuweisen + if (uploadGenreIds.length > 0 || uploadSpecialIds.length > 0) { const successfulUploads = results.filter(r => r.success && r.song); for (const result of successfulUploads) { try { @@ -649,12 +662,13 @@ export default function CuratorPageClient() { title: result.song.title, artist: result.song.artist, releaseYear: result.song.releaseYear, - genreIds: uploadGenreIds, + genreIds: uploadGenreIds.length > 0 ? uploadGenreIds : undefined, + specialIds: uploadSpecialIds.length > 0 ? uploadSpecialIds : undefined, }), }); } catch { - // Fehler beim Genre-Assigning werden nur geloggt, nicht abgebrochen - console.error(`Failed to assign genres to ${result.song.title}`); + // Fehler beim Zuweisen werden nur geloggt, nicht abgebrochen + console.error(`Failed to assign genres/specials to ${result.song.title}`); } } } @@ -1149,44 +1163,82 @@ export default function CuratorPageClient() { )}
-
-
{t('assignGenresLabel')}
- -
-
- {genres - .filter(g => curatorInfo?.genreIds?.includes(g.id)) - .map(genre => ( - - ))} - {curatorInfo && curatorInfo.genreIds.length === 0 && ( - - {t('noAssignedGenres')} - - )} +
+
+
+
{t('assignGenresLabel')}
+ +
+
+ {genres + .filter(g => curatorInfo?.genreIds?.includes(g.id)) + .map(genre => ( + + ))} + {curatorInfo && curatorInfo.genreIds.length === 0 && ( + + {t('noAssignedGenres')} + + )} +
+
+ +
+
+
{t('assignSpecialsLabel')}
+
+
+ {specials + .filter(s => curatorInfo?.specialIds?.includes(s.id)) + .map(special => ( + + ))} +
+
diff --git a/messages/de.json b/messages/de.json index 45fbe77..0f9df94 100644 --- a/messages/de.json +++ b/messages/de.json @@ -203,6 +203,7 @@ "selectedFilesTitle": "Ausgewählte Dateien:", "uploadProgress": "Upload: {current} / {total}", "assignGenresLabel": "Genres zuordnen", + "assignSpecialsLabel": "Specials zuordnen", "noAssignedGenres": "Dir sind noch keine Genres zugeordnet. Bitte wende dich an den Admin.", "uploadButtonIdle": "Upload starten", "uploadButtonUploading": "Lade hoch...", @@ -311,12 +312,12 @@ "uploadTitle": "Songs hochladen", "uploadStepsTitle": "Schritt-für-Schritt-Anleitung", "uploadStep1": "MP3-Dateien in den Upload-Bereich ziehen oder klicken, um Dateien auszuwählen", - "uploadStep2": "Ein oder mehrere Genres auswählen, um sie den hochgeladenen Songs zuzuordnen", + "uploadStep2": "Ein oder mehrere Genres und – falls passend – Specials auswählen, um sie den hochgeladenen Songs zuzuordnen", "uploadStep3": "Auf 'Upload starten' klicken, um den Upload-Prozess zu beginnen", "uploadStep4": "Das System extrahiert automatisch Metadaten (Titel, Artist, Erscheinungsjahr) aus den Dateien", "uploadBestPracticesTitle": "Best Practices", "uploadBestPractice1": "Stelle sicher, dass MP3-Dateien korrekte ID3-Tags (Titel, Artist) für die automatische Metadaten-Extraktion haben", - "uploadBestPractice2": "Passende Genres vor dem Upload auswählen, um spätere manuelle Zuordnung zu vermeiden", + "uploadBestPractice2": "Passende Genres (und Specials) vor dem Upload auswählen, um spätere manuelle Zuordnung zu vermeiden", "uploadBestPractice3": "Vor dem Upload auf Duplikate prüfen - das System warnt dich, wenn ein Song bereits existiert", "tip": "Tipp", "uploadTip": "Alle von Kuratoren hochgeladenen Songs werden automatisch von der globalen Playlist ausgeschlossen. Nur Admins können diese Einstellung ändern.", diff --git a/messages/en.json b/messages/en.json index 23e0916..22b9635 100644 --- a/messages/en.json +++ b/messages/en.json @@ -203,6 +203,7 @@ "selectedFilesTitle": "Selected files:", "uploadProgress": "Upload: {current} / {total}", "assignGenresLabel": "Assign genres", + "assignSpecialsLabel": "Assign specials", "noAssignedGenres": "No genres are assigned to you yet. Please contact the admin.", "uploadButtonIdle": "Start upload", "uploadButtonUploading": "Uploading...", @@ -311,12 +312,12 @@ "uploadTitle": "Uploading Songs", "uploadStepsTitle": "Step-by-Step Guide", "uploadStep1": "Drag MP3 files into the upload area or click to select files", - "uploadStep2": "Select one or more genres to assign to the uploaded songs", + "uploadStep2": "Select one or more genres and, if applicable, specials to assign to the uploaded songs", "uploadStep3": "Click 'Start upload' to begin the upload process", "uploadStep4": "The system will automatically extract metadata (title, artist, release year) from the files", "uploadBestPracticesTitle": "Best Practices", "uploadBestPractice1": "Ensure MP3 files have correct ID3 tags (title, artist) for automatic metadata extraction", - "uploadBestPractice2": "Select appropriate genres before uploading to avoid manual assignment later", + "uploadBestPractice2": "Select appropriate genres (and specials) before uploading to avoid manual assignment later", "uploadBestPractice3": "Check for duplicates before uploading - the system will warn you if a song already exists", "tip": "Tip", "uploadTip": "All songs uploaded by curators are automatically excluded from the global playlist. Only admins can change this setting.",