Class PlaylistServiceImpl

java.lang.Object
org.localify.playlist.PlaylistServiceImpl
All Implemented Interfaces:
PlaylistService

@Service @Transactional public class PlaylistServiceImpl extends Object implements PlaylistService
Implementation of the PlaylistService interface.
  • 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: PlaylistService
      Creates or updates a user's city playlist.
      Specified by:
      createOrUpdateUserCityPlaylist in interface PlaylistService
      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: PlaylistService
      Creates or updates a user's festival playlist.
      Specified by:
      createOrUpdateUserFestivalPlaylist in interface PlaylistService
      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

      public void savePlaylistToSpotify(Playlist playlist, UUID userId)
      Description copied from interface: PlaylistService
      Saves a playlist to Spotify for a user.
      Specified by:
      savePlaylistToSpotify in interface PlaylistService
      Parameters:
      playlist - The playlist to save.
      userId - The ID of the user.
    • createOrUpdateCityPlaylist

      public Playlist createOrUpdateCityPlaylist(UUID cityId)
      Description copied from interface: PlaylistService
      Creates or updates a city playlist.
      Specified by:
      createOrUpdateCityPlaylist in interface PlaylistService
      Parameters:
      cityId - The ID of the city.
      Returns:
      The created or updated playlist.
    • createOrUpdateVenuePlaylist

      public Playlist createOrUpdateVenuePlaylist(UUID venueId)
      Description copied from interface: PlaylistService
      Creates or updates a venue playlist.
      Specified by:
      createOrUpdateVenuePlaylist in interface PlaylistService
      Parameters:
      venueId - The ID of the venue.
      Returns:
      The created or updated playlist.
    • saveNonUserPlaylistToSpotify

      public void saveNonUserPlaylistToSpotify(Playlist playlist)
      Description copied from interface: PlaylistService
      Saves a non-user playlist to Spotify.
      Specified by:
      saveNonUserPlaylistToSpotify in interface PlaylistService
      Parameters:
      playlist - The playlist to save.