"""Database operations for OrchardAsset nodes.""" from connector_neo4j import get_session from sound_recordings.cypher import orchard_assets as cypher def get_track_ids(asset_id): """Get all active Track.id(s) attached to asset. Args: asset_id (uuid): asset uuid to match Returns: list (int): tuids attached to asset """ neo4j_session = get_session() results = neo4j_session.run( cypher.GET_TRACK_IDS, asset_id=str(asset_id) ) data = results.single() return data['tuids']