Interface SongAPIOptions

Options for searching songs from Database To search for all tracks with a specific term, surround the term with %. Eg. if the term is 'aaa', to get all songs containing 'aaa' in the title, put the term as '%aaa%' in 'song.title'.

interface SongAPIOptions {
    album?: Partial<Album>;
    artist?: Partial<Artist>;
    genre?: Partial<Genre>;
    inclusive?: boolean;
    invert?: boolean;
    playlist?: Partial<Playlist>;
    song?: SearchableSong;
    sortBy?: SongSortOptions | SongSortOptions[];
}

Properties

album?: Partial<Album>

To search tracks by properties in album, specify this property.

artist?: Partial<Artist>

To search tracks by properties in artists, specify this property.

genre?: Partial<Genre>

To search tracks by properties in genre, specify this property.

inclusive?: boolean

If false, then the exact match of all options will be provided. If true, then even if a track matches one of the options, it will be returned. In terms of SQL, true will add 'AND' between where queries and false will add 'OR'.

Eg. If song.title is 'aaa' and album.album_name is 'bbb'

In this scenario if inclusive is true, then all tracks having title as 'aaa' AND album_name as 'bbb' will be returned

If inclusive is false then songs having title as 'aaa' OR album_name as 'bbb' will be returned

False by default

invert?: boolean

If true, then inverts the query. It will return all records which don't match the search criteria If false, then it will return all records which match the search criteria

false by default

playlist?: Partial<Playlist>

To search tracks by properties in playlist, specify this property.

To search tracks by properties in song, specify this property.

sortBy?: SongSortOptions | SongSortOptions[]

To sort the results, specify this property