Fix blacklist model to reflect db changes

This commit is contained in:
anthorob committed 2022-01-04 19:05:39 -05:00
1 parent 3bccd6ce5a
commit 6e1f4c2027
7 files changed
+9 -20

No files matched your search

@@ -13,6 +13,11 @@ import netneutrality.MusicBot;
public abstract class AbstractMusicCommand extends AbstractCommand { public abstract class AbstractMusicCommand extends AbstractCommand {
@Override
public boolean needAdmin() {
return false;
}
@Override @Override
public CommandType getType() { public CommandType getType() {
return CommandType.MUSIC; return CommandType.MUSIC;
@@ -14,10 +14,6 @@ import netneutrality.command.Visibility;
import netneutrality.music.MusicManager; import netneutrality.music.MusicManager;
public class BitconnectCommand extends AbstractMusicCommand { public class BitconnectCommand extends AbstractMusicCommand {
@Override
public boolean needAdmin() {
return true;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
@@ -14,10 +14,6 @@ import netneutrality.command.Visibility;
import netneutrality.music.MusicManager; import netneutrality.music.MusicManager;
public class JoinCommand extends AbstractMusicCommand { public class JoinCommand extends AbstractMusicCommand {
@Override
public boolean needAdmin() {
return true;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
@@ -14,10 +14,6 @@ import netneutrality.command.Visibility;
import netneutrality.music.MusicManager; import netneutrality.music.MusicManager;
public class PlayCommand extends AbstractMusicCommand { public class PlayCommand extends AbstractMusicCommand {
@Override
public boolean needAdmin() {
return true;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
@@ -10,10 +10,6 @@ import netneutrality.command.AbstractMusicCommand;
import netneutrality.command.Visibility; import netneutrality.command.Visibility;
public class VoteSkipCommand extends AbstractMusicCommand { public class VoteSkipCommand extends AbstractMusicCommand {
@Override
public boolean needAdmin() {
return false;
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
@@ -36,13 +36,13 @@ public abstract class AbstractEntity implements EntityInterface {
String sql = "SELECT * FROM " + getTableName() + " WHERE " + whereClause; String sql = "SELECT * FROM " + getTableName() + " WHERE " + whereClause;
System.out.println(sql + " - pk: " + primaryKey); MusicBot.logger.debug(sql + " - pk: " + primaryKey);
if (this.primaryKeys.length > 0) if (this.primaryKeys.length > 0)
this.table = DBController.get().prepareAndExecuteAsync(sql, this.primaryKey, this.primaryKeys).blocking(); this.table = DBController.get().prepareAndExecuteAsync(sql, this.primaryKey, this.primaryKeys).blocking();
else else
this.table = DBController.get().prepareAndExecuteAsync(sql, this.primaryKey).blocking(); this.table = DBController.get().prepareAndExecuteAsync(sql, this.primaryKey).blocking();
System.out.println(table);
} }
} }
@@ -17,10 +17,10 @@ public class MBlacklist {
} }
public MBlacklist(List<Object> row) { public MBlacklist(List<Object> row) {
this.word = (String) row.get(0); this.word = (String) row.get(1);
this.enabled = (Boolean) row.get(2); this.enabled = (Boolean) row.get(2);
this.creatorId = (String) row.get(3); this.creatorId = (String) row.get(3);
this.serverId = (String) row.get(1); this.serverId = (String) row.get(0);
} }
/** /**