Implement user onboarding and enhanced .strm file creation
- Added automated onboarding dialog for new users to pick genres, eras, and content types. - Enhanced "Add Movie" functionality to support folder-per-movie structure with Year and IMDb ID. - Improved ui.js with custom dialogs for Onboarding, Rating, and Adding Movies. - Fixed API accessibility by using standard [Authorize] attributes. - Added "Mark Viewed" and "Sync" actions to the UI. Co-authored-by: devitq <118541411+devitq@users.noreply.github.com>
This commit is contained in:
co-authored by
devitq
parent
4dc806263a
commit
b59514a6eb
@@ -0,0 +1,29 @@
|
||||
package com.project.movienight.application.services
|
||||
|
||||
import com.project.movienight.application.ports.input.GetUserPreferencesUseCase
|
||||
import com.project.movienight.application.ports.input.UpsertUserPreferencesCommand
|
||||
import com.project.movienight.application.ports.input.UpsertUserPreferencesUseCase
|
||||
import com.project.movienight.application.ports.output.UserPreferencesRepositoryPort
|
||||
import com.project.movienight.domain.model.UserPreferences
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class UserPreferencesService(
|
||||
private val userPreferencesRepository: UserPreferencesRepositoryPort,
|
||||
) : UpsertUserPreferencesUseCase,
|
||||
GetUserPreferencesUseCase {
|
||||
override fun upsert(command: UpsertUserPreferencesCommand): UserPreferences =
|
||||
userPreferencesRepository.save(
|
||||
UserPreferences(
|
||||
userId = command.userId,
|
||||
weightedGenres = command.weightedGenres,
|
||||
plotTypes = command.plotTypes,
|
||||
eras = command.eras,
|
||||
castAndDirectors = command.castAndDirectors,
|
||||
moods = command.moods,
|
||||
contentTypes = command.contentTypes,
|
||||
),
|
||||
)
|
||||
|
||||
override fun get(userId: java.util.UUID): UserPreferences? = userPreferencesRepository.findByUserId(userId)
|
||||
}
|
||||
Reference in New Issue
Block a user