Class AudioActivity
java.lang.Object
dev.jacrispys.JavaBot.api.analytics.objects.AudioActivity
API component that allows access to the 'AudioActivity' database table
- See Also:
-
AudioActivities
-
Method Summary
Modifier and TypeMethodDescriptionstatic AudioActivity
getAudioActivity
(AudioUser user) Instance manager for audio activity objects.protected Object
getGuildStat
(long guildId, @NotNull dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) Obtains a statistic from the 'audio_activity' table withAudioActivities
as a query parameterlong
getListenTimeMillis
(long guildId) Specified internal call togetGuildStat(long, AudioActivities)
long
getPlaylistQueues
(long guildId) Specified internal call togetGuildStat(long, AudioActivities)
long
getSkipOthers
(long guildId) Specified internal call togetGuildStat(long, AudioActivities)
long
getSongQueues
(long guildId) Specified internal call togetGuildStat(long, AudioActivities)
void
incrementStat
(long guildId, int increment, dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) Increments a given stat in the 'guild_general_stats' database tablevoid
incrementStat
(long guildId, @NotNull dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) Increments a given stat in the 'guild_general_stats' database table
-
Method Details
-
getAudioActivity
public static AudioActivity getAudioActivity(AudioUser user) throws ExecutionException, InterruptedException Instance manager for audio activity objects.- Parameters:
user
- to obtain data from- Returns:
- instance of the current class if it exists, or creates a new one.
- Throws:
ExecutionException
- if an async connection failsInterruptedException
- if the thread gets blocked- See Also:
-
getGuildStat
protected Object getGuildStat(long guildId, @NotNull @NotNull dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) throws SQLException Obtains a statistic from the 'audio_activity' table withAudioActivities
as a query parameter- Parameters:
guildId
- to filter by in the databaseactivity
- - the type of data to be retrieved- Returns:
- a POJO from the MySQL
ResultSet
- Throws:
SQLException
- if a database exception occurs
-
incrementStat
public void incrementStat(long guildId, @NotNull @NotNull dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) Increments a given stat in the 'guild_general_stats' database table- Parameters:
guildId
- for correct row to updateactivity
- - type of activity to increment stat for- See Also:
-
incrementStat
public void incrementStat(long guildId, int increment, dev.jacrispys.JavaBot.api.analytics.objects.AudioActivities activity) Increments a given stat in the 'guild_general_stats' database table- Parameters:
guildId
- for correct row to updateactivity
- - type of activity to increment stat forincrement
- - int value to increase the dataset by- See Also:
-
getSongQueues
Specified internal call togetGuildStat(long, AudioActivities)
- Parameters:
guildId
- to update the data in- Returns:
- number of song queues from given guild
- Throws:
SQLException
- if a database error occurs
-
getPlaylistQueues
Specified internal call togetGuildStat(long, AudioActivities)
- Parameters:
guildId
- to update the data in- Returns:
- number of playlist queues from given guild
- Throws:
SQLException
- if a database error occurs
-
getListenTimeMillis
Specified internal call togetGuildStat(long, AudioActivities)
- Parameters:
guildId
- to update the data in- Returns:
- number of milliseconds listened from given guild
- Throws:
SQLException
- if a database error occurs
-
getSkipOthers
Specified internal call togetGuildStat(long, AudioActivities)
- Parameters:
guildId
- to update the data in- Returns:
- number of times tracks have been skipped by users who didn't queue them
- Throws:
SQLException
- if a database error occurs
-