pylav.storage.controllers package#

Subpackages#

Submodules#

pylav.storage.controllers.config module#

class pylav.storage.controllers.config.ConfigController(client)[source]#

Bases: object

property client#
async static create_tables()[source]#
get_bot_db_version()[source]#
get_config()[source]#
async initialize()[source]#
async reset_database()[source]#
async update_bot_dv_version(version)[source]#

pylav.storage.controllers.equalizers module#

class pylav.storage.controllers.equalizers.EqualizerController(client)[source]#

Bases: object

property client#
async static count()[source]#

Returns the number of equalizers in the database.

async create_or_update_channel_equalizer(text_channel, identifier, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async static create_or_update_equalizer(identifier, scope, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async create_or_update_global_equalizer(identifier, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async create_or_update_guild_equalizer(guild, identifier, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async create_or_update_user_equalizer(user_id, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async create_or_update_vc_equalizer(voice_channel, identifier, author, name, description=None, band_25=None, band_40=None, band_63=None, band_100=None, band_160=None, band_250=None, band_400=None, band_630=None, band_1000=None, band_1600=None, band_2500=None, band_4000=None, band_6300=None, band_10000=None, band_16000=None)[source]#
async static delete_equalizer(equalizer_id)[source]#
static get_all_equalizers()[source]#
static get_all_equalizers_by_author(author)[source]#
static get_all_equalizers_by_scope(scope)[source]#
static get_all_equalizers_by_scope_and_author(scope, author)[source]#
async get_all_for_user(requester, *, voice_channel=None, guild=None, channel=None)[source]#

Gets all equalizers a user has access to in a given context.

Globals, User specific, Guild specific, Channel specific, VC specific.

async static get_equalizer_by_id(identifier)[source]#
async static get_equalizer_by_name(equalizer_name, limit=None)[source]#
async get_equalizer_by_name_or_id(equalizer_name_or_id, limit=None)[source]#
async static get_equalizers_by_author(author)[source]#
async static get_equalizers_by_scope(scope)[source]#
async get_global_equalizers()[source]#
async get_manageable_equalizers(requester, bot, *, name_or_id=None)[source]#

pylav.storage.controllers.migrator module#

class pylav.storage.controllers.migrator.MigrationController(client)[source]#

Bases: object

async run_deferred_tasks_which_depend_on_node()[source]#
async run_updates()[source]#

Run through schema migrations

pylav.storage.controllers.nodes module#

class pylav.storage.controllers.nodes.NodeController(client)[source]#

Bases: object

bundled_node_config()[source]#
property client#
async static count()[source]#

Return the number of unbundled nodes in the database.

currently_in_db#
async delete(node_id)[source]#
async get_all_nodes()[source]#
async get_all_unmanaged_nodes(dedupe=True)[source]#
async get_bundled_node_config()[source]#
get_node_config(node_id)[source]#
async update_node(host, port, password, unique_identifier, resume_timeout=60, name=None, reconnect_attempts=-1, ssl=False, search_only=False, managed=False, extras=None, yaml=None, disabled_sources=None)[source]#

Add a new node to the database.

Parameters:
  • host (str) – The host of the node.

  • port (int) – The port of the node.

  • password (str) – The password of the node.

  • unique_identifier (int) – The unique identifier of the node.

  • name (str) – The name of the node.

  • resume_timeout (int) – The resume timeout of the node.

  • reconnect_attempts (int) – The reconnect attempts of the node.

  • ssl (bool) – Whether the node is using ssl.

  • search_only (bool) – Whether the node is search only.

  • managed (bool) – Whether the node is managed.

  • extras (dict) – The extras of the node.

  • disabled_sources (list[str]) – The disabled sources of the node.

  • yaml (dict) – The yaml of the node.

pylav.storage.controllers.playlists module#

class pylav.storage.controllers.playlists.PlaylistController(client)[source]#

Bases: object

property client#
async static count()[source]#

Returns the number of playlists in the database.

async create_or_update_channel_playlist(channel, author, name, url=None, tracks=None)[source]#
async create_or_update_global_playlist(identifier, author, name, url=None, tracks=None)[source]#
async create_or_update_guild_playlist(guild, author, name, url=None, tracks=None)[source]#
async create_or_update_playlist(identifier, scope, author, name, url=None, tracks=None)[source]#
async create_or_update_user_playlist(identifier, author, name, url=None, tracks=None)[source]#
async create_or_update_vc_playlist(vc, author, name, url=None, tracks=None)[source]#
async delete_playlist(playlist_id)[source]#
async get_all_for_user(requester, empty=False, *, vc=None, guild=None, channel=None)[source]#

Gets all playlists a user has access to in a given context. Globals, User specific, Guild specific, Channel specific, VC specific.

async get_all_playlists()[source]#
async get_bundled_playlists()[source]#
async get_external_playlists(*ids, ignore_ids=None)[source]#
async get_manageable_playlists(requester, bot, *, name_or_id=None)[source]#
static get_playlist(**kwargs)[source]#
async get_playlist_by_id(playlist_id)[source]#
async get_playlist_by_name(playlist_name, limit=None)[source]#
async get_playlist_by_name_or_id(playlist_name_or_id, limit=None)[source]#
async get_playlists_by_author(author, return_empty=True)[source]#
async get_playlists_by_scope(scope, return_empty=True)[source]#
async update_bundled_external_playlists(*playlist_ids)[source]#
async update_bundled_playlists(*playlist_ids)[source]#
async update_external_playlists(*playlist_ids)[source]#

pylav.storage.controllers.queries module#

class pylav.storage.controllers.queries.QueryController(client)[source]#

Bases: object

async static add_query(query, result)[source]#
property client#
async delete_old()[source]#
async static delete_older_than(days)[source]#
async static delete_query(query)[source]#
async static exists(query)[source]#
async fetch_query(query)[source]#
static get(identifier)[source]#

Get a query object

async static size()[source]#
async static wipe()[source]#

Module contents#