Plugin:AutoDJ:Queue MySQL

From ShoutIRC RadioBot Wiki
Jump to navigation Jump to search

This is a plugin for AutoDJ which keeps your playlist and ID3 cache in a MySQL database. This plugin provides a few benefits over the memory queue, including less memory usage and easier integration with WebRequest systems.

Configuration

You need this in your AutoDJ/Options section to load the MySQL Queue plugin:
QueuePlugin			.\plugins\adjq_mysql.dll (Win32)
- or -
QueuePlugin			./plugins/adjq_mysql.so (Linux)

And an AutoDJ/Queue_MySQL section as outlined here.

Commands

!songstop10
This will PM you the top requested songs (requires KeepHistory set in AutoDJ/Queue_MySQL).
!requesterstop10
This will PM you the top requesters (requires KeepHistory set in AutoDJ/Queue_MySQL).
!autodj-clear
This will clear your MySQL queue database. Make sure you !autodj-reload afterwards or you won't have any songs to play.
!autodj-qstat
This will show some stats about your MySQL queue database.

Database Schema

Note: This schema is subject to change and you SHOULD NOT create the table yourself, the plugin will do it automatically.
Here is the SQL query needed to create the AutoDJ table:

CREATE TABLE `AutoDJ` (
 `ID` int(10) unsigned NOT NULL,
 `Path` varchar(255) NOT NULL,
 `FN` varchar(255) NOT NULL,
 `mTime` int(11) NOT NULL,
 `LastPlayed` int(11) NOT NULL,
 `PlayCount` int(11) NOT NULL,
 `LastReq` int(11) NOT NULL,
 `ReqCount` int(11) NOT NULL,
 `Title` varchar(255) NOT NULL,
 `Artist` varchar(255) NOT NULL,
 `Album` varchar(255) NOT NULL,
 `Genre` varchar(255) NOT NULL,
 `SongLen` int(11) NOT NULL,
 PRIMARY KEY  (`ID`)
);

Field Descriptions

ID - The file ID.
 On Windows, this is the CRC of the full path and filename in lower case.
 On Linux/other, this is the CRC of the full path and filename, but not converted to lowercase first since those systems filesystems are case sensitive.
Path - The folder the file is in. 
FN - The filename of the file (without the path).
 Note: If you want the full path and filename in a query, you can use CONCAT(Path,FN)
mTime - The file's last modification time in standard C time() style. AutoDJ uses this to know whether it should re-read the file's meta tags.
LastPlayed - The timestamp of the last time the file was queued for playback.
PlayCount - The number of times the file has been queued for playback.
LastReq - This field will hold the last time the file was requested. Currently AutoDJ doesn't fill this in for !request, etc., but should in the future.
ReqCount - This field will hold how many times the file has been requested. Currently AutoDJ doesn't fill this in for !request, etc., but should in the future.
Title/Artist/Album/Genre - Holds the meta info read from the file, it should be obvious which is which.
SongLen - The length of the song in seconds, if available.


RadioBot vde

RadioBot main pages
Main PageInstallationChangelogCommandsPluginsFAQConfigurationCreditsRemote ClientBuilt-In VariablesMulti Sound Server ModeUsername Character Restrictions
Auto DJ Pages
Auto DJ Main PageWebRequest SystemSchedulerMP3 EncoderVoice SupportMySQL Plugin