pylav.storage.models.node package#

Submodules#

pylav.storage.models.node.mocked module#

class pylav.storage.models.node.mocked.NodeMock(*, id: 'int', data: 'JSON_DICT_TYPE')[source]#

Bases: CachedModel

async add_to_disabled_sources(source)[source]#

Add a source to the node’s disabled sources in the database

async bulk_add_to_disabled_sources(sources)[source]#

Add sources to the node’s disabled sources in the database

async bulk_remove_from_disabled_sources(sources)[source]#

Remove sources from the node’s disabled sources in the database

async classmethod create_managed(identifier)[source]#

Create the player in the database

data#
async delete()[source]#

Delete the node from the database

async static exists()[source]#

Check if the node exists in the database.

Returns:

Whether the node exists in the database.

Return type:

bool

async fetch_all()[source]#
async fetch_disabled_sources()[source]#

Fetch the node’s disabled sources from the database.

Returns:

The node’s disabled sources.

Return type:

list[str]

async fetch_extras()[source]#

Fetch the node’s extras from the database.

Returns:

The node’s extras.

Return type:

dict

async fetch_managed()[source]#

Fetch the node’s managed setting from the database.

Returns:

The node’s managed setting.

Return type:

bool

async fetch_name()[source]#

Fetch the node from the database.

Returns:

The node’s name.

Return type:

ste

async fetch_reconnect_attempts()[source]#

Fetch the node’s reconnect attempts from the database.

Returns:

The node’s reconnect attempts.

Return type:

int

async fetch_resume_timeout()[source]#

Fetch the node’s resume timeout from the database.

Returns:

The node’s resume timeout.

Return type:

int

async fetch_search_only()[source]#

Fetch the node’s search only setting from the database.

Returns:

The node’s search only setting.

Return type:

bool

async fetch_session()[source]#

Fetch the node’s session from the database.

Returns:

The node’s session.

Return type:

str | None

async fetch_ssl()[source]#

Fetch the node’s ssl setting from the database.

Returns:

The node’s ssl setting.

Return type:

bool

async fetch_yaml()[source]#

Fetch the node’s yaml from the database.

Returns:

The node’s yaml.

Return type:

dict

get_cache_key()[source]#
async get_connection_args()[source]#

Get the connection args for the node.

Returns:

The connection args.

Return type:

dict

id#
async remove_from_disabled_sources(source)[source]#

Remove a source from the node’s disabled sources in the database

session_id#
async update_disabled_sources(disabled_sources)[source]#

Update the node’s disabled sources in the database

async update_extras(extras)[source]#

Update the node’s extras in the database

async update_managed(managed)[source]#

Update the node’s managed setting in the database

async update_name(name)[source]#

Update the node’s name in the database

async update_reconnect_attempts(reconnect_attempts)[source]#

Update the node’s reconnect attempts in the database

async update_resume_timeout(resume_timeout)[source]#

Update the node’s resume timeout in the database

async update_search_only(search_only)[source]#

Update the node’s search only setting in the database

async update_session(session)[source]#

Update the node’s session in the database

async update_ssl(ssl)[source]#

Update the node’s ssl setting in the database

async update_yaml(yaml_data)[source]#

Update the node’s yaml in the database

pylav.storage.models.node.real module#

class pylav.storage.models.node.real.Node(*args: 'Any', **kwargs: 'Any')[source]#

Bases: CachedModel

async add_to_disabled_sources(source)[source]#

Add a source to the node’s disabled sources in the database

async bulk_add_to_disabled_sources(sources)[source]#

Add sources to the node’s disabled sources in the database

async bulk_remove_from_disabled_sources(sources)[source]#

Remove sources from the node’s disabled sources in the database

async bulk_update(host, port, password, resume_timeout=60, name=None, reconnect_attempts=-1, ssl=False, search_only=False, managed=False, extras=None, yaml=None, disabled_sources=None)[source]#

Update the node’s data in the database

async classmethod create_managed(identifier)[source]#

Create the player in the database

async delete()[source]#

Delete the node from the database

async exists()[source]#

Check if the node exists in the database.

Returns:

Whether the node exists in the database.

Return type:

bool

async fetch_all()[source]#
async fetch_disabled_sources()[source]#

Fetch the node’s disabled sources from the database.

Returns:

The node’s disabled sources.

Return type:

list[str]

async fetch_extras()[source]#

Fetch the node’s extras from the database.

Returns:

The node’s extras.

Return type:

dict

async fetch_managed()[source]#

Fetch the node’s managed setting from the database.

Returns:

The node’s managed setting.

Return type:

bool

async fetch_name()[source]#

Fetch the node from the database.

Returns:

The node’s name.

Return type:

str

async fetch_reconnect_attempts()[source]#

Fetch the node’s reconnect attempts from the database.

Returns:

The node’s reconnect attempts.

Return type:

int

async fetch_resume_timeout()[source]#

Fetch the node’s resume timeout from the database.

Returns:

The node’s resume timeout.

Return type:

int

async fetch_search_only()[source]#

Fetch the node’s search only setting from the database.

Returns:

The node’s search only setting.

Return type:

bool

async fetch_session()[source]#

Fetch the node’s session from the database

async fetch_ssl()[source]#

Fetch the node’s ssl setting from the database.

Returns:

The node’s ssl setting.

Return type:

bool

async fetch_yaml()[source]#

Fetch the node’s yaml from the database.

Returns:

The node’s yaml.

Return type:

dict

get_cache_key()[source]#
async get_connection_args()[source]#

Get the connection args for the node.

Returns:

The connection args.

Return type:

dict

id#
async remove_from_disabled_sources(source)[source]#

Remove a source from the node’s disabled sources in the database

async update_disabled_sources(disabled_sources)[source]#

Update the node’s disabled sources in the database

async update_extras(extras)[source]#

Update the node’s extras in the database

async update_managed(managed)[source]#

Update the node’s managed setting in the database

async update_name(name)[source]#

Update the node’s name in the database

async update_reconnect_attempts(reconnect_attempts)[source]#

Update the node’s reconnect attempts in the database

async update_resume_timeout(resume_timeout)[source]#

Update the node’s resume timeout in the database

async update_search_only(search_only)[source]#

Update the node’s search only setting in the database

async update_session(session)[source]#

Update the node’s session in the database

async update_ssl(ssl)[source]#

Update the node’s ssl setting in the database

async update_yaml(yaml_data)[source]#

Update the node’s yaml in the database

Module contents#