Package org.localify.data.dispatch
Class SpotifyApiDispatch
java.lang.Object
org.localify.data.dispatch.SpotifyApiDispatch
A service for dispatching Spotify API requests.
-
Constructor Summary
ConstructorsConstructorDescriptionSpotifyApiDispatch(ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, SpotifyService spotifyService, SongRepository songRepository) Constructs a new SpotifyApiDispatch. -
Method Summary
Modifier and TypeMethodDescriptionvoidbulkDispatchArtistTracksSpotifyApi(List<Artist> artists) Bulk dispatches artists to have their tracks updated via the Spotify API.voiddispatchArtistsSpotifyApi(List<Artist> artists) Dispatches a list of artists to be updated via the Spotify API.voidDispatches tracks to have their acoustic information updated via the Spotify API.voidqueueArtistsBulk(int limit) Queues all artists in the database for a bulk update.voidqueueArtistsUpdatedBefore(Instant time, int limit) Queues artists that were updated before a certain time.
-
Constructor Details
-
SpotifyApiDispatch
public SpotifyApiDispatch(ArtistRepository artistRepository, jakarta.persistence.EntityManager entityManager, SpotifyService spotifyService, SongRepository songRepository) Constructs a new SpotifyApiDispatch.- Parameters:
artistRepository- The artist repository.entityManager- The entity manager.spotifyService- The Spotify service.songRepository- The song repository.
-
-
Method Details
-
dispatchArtistsSpotifyApi
Dispatches a list of artists to be updated via the Spotify API.- Parameters:
artists- The list of artists to dispatch.
-
bulkDispatchArtistTracksSpotifyApi
Bulk dispatches artists to have their tracks updated via the Spotify API.- Parameters:
artists- The list of artists to dispatch.
-
dispatchTracksAcousticInformation
Dispatches tracks to have their acoustic information updated via the Spotify API.- Parameters:
songs- The list of songs to dispatch.
-
queueArtistsUpdatedBefore
Queues artists that were updated before a certain time.- Parameters:
time- The time to check against.limit- The maximum number of artists to queue.
-
queueArtistsBulk
public void queueArtistsBulk(int limit) Queues all artists in the database for a bulk update.- Parameters:
limit- The maximum number of artists to queue.
-