Package org.localify.playlist
Class PlaylistServiceImpl
java.lang.Object
org.localify.playlist.PlaylistServiceImpl
- All Implemented Interfaces:
PlaylistService
Implementation of the PlaylistService interface.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaylistServiceImpl(UserCityRepository userCityRepository, UserRepository userRepository, CityRepository cityRepository, SongRepository songRepository, ArtistRepository artistRepository, UserArtistRecommendationRepository userArtistRecommendationRepository) Constructs a new PlaylistServiceImpl. -
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdateCityPlaylist(UUID cityId) Creates or updates a city playlist.createOrUpdateUserCityPlaylist(UUID userId, UUID cityId, List<RecommendedArtistDto> recs, int localPerSeed, boolean useSeedSong) Creates or updates a user's city playlist.createOrUpdateUserFestivalPlaylist(UUID userId, UUID festivalId, List<RecommendedFestivalArtistDto> recs, int localPerSeed, boolean useSeedSong) Creates or updates a user's festival playlist.createOrUpdateVenuePlaylist(UUID venueId) Creates or updates a venue playlist.voidsaveNonUserPlaylistToSpotify(Playlist playlist) Saves a non-user playlist to Spotify.voidsavePlaylistToSpotify(Playlist playlist, UUID userId) Saves a playlist to Spotify for a user.
-
Constructor Details
-
PlaylistServiceImpl
public PlaylistServiceImpl(UserCityRepository userCityRepository, UserRepository userRepository, CityRepository cityRepository, SongRepository songRepository, ArtistRepository artistRepository, UserArtistRecommendationRepository userArtistRecommendationRepository) Constructs a new PlaylistServiceImpl.- Parameters:
userCityRepository- The user city repository.userRepository- The user repository.cityRepository- The city repository.songRepository- The song repository.artistRepository- The artist repository.userArtistRecommendationRepository- The user artist recommendation repository.
-
-
Method Details
-
createOrUpdateUserCityPlaylist
public Playlist createOrUpdateUserCityPlaylist(UUID userId, UUID cityId, List<RecommendedArtistDto> recs, int localPerSeed, boolean useSeedSong) Description copied from interface:PlaylistServiceCreates or updates a user's city playlist.- Specified by:
createOrUpdateUserCityPlaylistin interfacePlaylistService- Parameters:
userId- The ID of the user.cityId- The ID of the city.recs- A list of recommended artists.localPerSeed- The number of local artists to include per seed artist.useSeedSong- Whether to include a song from the seed artist.- Returns:
- The created or updated playlist.
-
createOrUpdateUserFestivalPlaylist
public Playlist createOrUpdateUserFestivalPlaylist(UUID userId, UUID festivalId, List<RecommendedFestivalArtistDto> recs, int localPerSeed, boolean useSeedSong) Description copied from interface:PlaylistServiceCreates or updates a user's festival playlist.- Specified by:
createOrUpdateUserFestivalPlaylistin interfacePlaylistService- Parameters:
userId- The ID of the user.festivalId- The ID of the festival.recs- A list of recommended festival artists.localPerSeed- The number of local artists to include per seed artist.useSeedSong- Whether to include a song from the seed artist.- Returns:
- The created or updated playlist.
-
savePlaylistToSpotify
Description copied from interface:PlaylistServiceSaves a playlist to Spotify for a user.- Specified by:
savePlaylistToSpotifyin interfacePlaylistService- Parameters:
playlist- The playlist to save.userId- The ID of the user.
-
createOrUpdateCityPlaylist
Description copied from interface:PlaylistServiceCreates or updates a city playlist.- Specified by:
createOrUpdateCityPlaylistin interfacePlaylistService- Parameters:
cityId- The ID of the city.- Returns:
- The created or updated playlist.
-
createOrUpdateVenuePlaylist
Description copied from interface:PlaylistServiceCreates or updates a venue playlist.- Specified by:
createOrUpdateVenuePlaylistin interfacePlaylistService- Parameters:
venueId- The ID of the venue.- Returns:
- The created or updated playlist.
-
saveNonUserPlaylistToSpotify
Description copied from interface:PlaylistServiceSaves a non-user playlist to Spotify.- Specified by:
saveNonUserPlaylistToSpotifyin interfacePlaylistService- Parameters:
playlist- The playlist to save.
-