Lidarr

Note

An asynchronous version of this client is available as AsyncLidarr. The API is identical, but all methods are coroutines and must be awaited.

class pyarr._sync.lidarr.Lidarr(host: str, api_key: str, port: int = 8686, tls: bool = True, base_path: str = '', request_timeout: int | None = None, api_ver: str | None = None)[source]

Lidarr API client.

Artist

class pyarr._sync.lidarr.artist.Artist(handler: RequestHandler)[source]

Artist actions for Lidarr.

get(item_id: int | str | None = None, mb_id: str | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns artists by ID or MusicBrainz ID.

Parameters:
  • item_id (int | str | None, optional) – Lidarr ID or MusicBrainz ID of artist. Defaults to None.

  • mb_id (str | None, optional) – MusicBrainz ID of artist. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(artist: dict[str, Any], root_dir: str, quality_profile_id: int, metadata_profile_id: int, monitored: bool = True, artist_monitor: str = 'all', search_for_missing_albums: bool = False) dict[str, Any][source]

Adds an artist to the database.

Parameters:
  • artist (JsonObject) – Artist record from lookup().

  • root_dir (str) – Location of the root directory.

  • quality_profile_id (int) – ID of the quality profile.

  • metadata_profile_id (int) – ID of the metadata profile.

  • monitored (bool, optional) – Should the artist be monitored. Defaults to True.

  • artist_monitor (str, optional) – Monitor type. Defaults to β€œall”.

  • search_for_missing_albums (bool, optional) – Search for missing albums. Defaults to False.

Returns:

Dictionary with added record.

Return type:

JsonObject

update(data: dict[str, Any]) dict[str, Any][source]

Updates an artist in the database.

Parameters:

data (JsonObject) – Dictionary containing artist data.

Returns:

Dictionary with updated record.

Return type:

JsonObject

delete(item_id: int) None[source]

Delete an artist by ID.

Parameters:

item_id (int) – The ID of the artist to delete.

lookup(term: str) list[dict[str, Any]][source]

Search for an artist to add to the database.

Parameters:

term (str) – Search term (can include lidarr: prefix for MusicBrainz ID).

Returns:

List of dictionaries with items.

Return type:

JsonArray

Album

class pyarr._sync.lidarr.album.Album(handler: RequestHandler)[source]

Album actions for Lidarr.

get(item_id: int | None = None, artist_id: int | None = None, album_ids: list[int] | None = None, foreign_album_id: str | None = None, all_artist_albums: bool = False) list[dict[str, Any]] | dict[str, Any][source]

Returns albums by ID, artist ID, or other criteria.

Parameters:
  • item_id (int | None, optional) – Lidarr ID of album. Defaults to None.

  • artist_id (int | None, optional) – Lidarr ID of artist. Defaults to None.

  • album_ids (list[int] | None, optional) – List of album IDs. Defaults to None.

  • foreign_album_id (str | None, optional) – Foreign album ID. Defaults to None.

  • all_artist_albums (bool, optional) – Include all artist albums. Defaults to False.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

add(album: dict[str, Any], root_dir: str, quality_profile_id: int, metadata_profile_id: int, monitored: bool = True, artist_monitored: bool = True, artist_monitor: str = 'all', artist_search_for_missing_albums: bool = False, search_for_new_album: bool = False) dict[str, Any][source]

Adds an album to Lidarr.

Parameters:
  • album (JsonObject) – Album record from lookup().

  • root_dir (str) – Location to store music.

  • quality_profile_id (int) – Quality profile ID.

  • metadata_profile_id (int) – Metadata profile ID.

  • monitored (bool, optional) – Should the album be monitored. Defaults to True.

  • artist_monitored (bool, optional) – Should the artist be monitored. Defaults to True.

  • artist_monitor (str, optional) – Artist monitor type. Defaults to β€œall”.

  • artist_search_for_missing_albums (bool, optional) – Search for missing albums. Defaults to False.

  • search_for_new_album (bool, optional) – Search for new album. Defaults to False.

Returns:

Dictionary with added record.

Return type:

JsonObject

update(data: dict[str, Any]) dict[str, Any][source]

Update an album.

Parameters:

data (JsonObject) – Data to update album.

Returns:

Dictionary of updated record.

Return type:

JsonObject

delete(item_id: int) None[source]

Delete an album by ID.

Parameters:

item_id (int) – Album ID to be deleted.

lookup(term: str) list[dict[str, Any]][source]

Search for an album to add to the database.

Parameters:

term (str) – Search term.

Returns:

List of dictionaries with items.

Return type:

JsonArray

Track

class pyarr._sync.lidarr.track.Track(handler: RequestHandler)[source]

Track actions for Lidarr.

get(artist_id: int | None = None, album_id: int | None = None, album_release_id: int | None = None, track_ids: list[int] | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns tracks based on provided IDs.

Parameters:
  • artist_id (int | None, optional) – Artist ID. Defaults to None.

  • album_id (int | None, optional) – Album ID. Defaults to None.

  • album_release_id (int | None, optional) – Album Release ID. Defaults to None.

  • track_ids (list[int] | None, optional) – Track IDs. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

Track File

class pyarr._sync.lidarr.track_file.TrackFile(handler: RequestHandler)[source]

Track file actions for Lidarr.

get(artist_id: int | None = None, album_id: int | None = None, track_file_ids: list[int] | None = None, unmapped: bool | None = None) list[dict[str, Any]] | dict[str, Any][source]

Returns track files based on IDs, or all unmapped files.

Parameters:
  • artist_id (int | None, optional) – Artist database ID. Defaults to None.

  • album_id (int | None, optional) – Album database ID. Defaults to None.

  • track_file_ids (list[int] | None, optional) – Specific file IDs. Defaults to None.

  • unmapped (bool | None, optional) – Get all unmapped files. Defaults to None.

Returns:

List of dictionaries with items or a single dictionary.

Return type:

JsonArray | JsonObject

update(data: dict[str, Any]) dict[str, Any][source]

Update an existing track file.

Parameters:

data (JsonObject) – Updated data for track files.

Returns:

Dictionary of updated record.

Return type:

JsonObject

delete(ids: int | list[int]) None[source]

Delete track files.

Parameters:

ids (int | list[int]) – Single ID or list of IDs for files to delete.

Release

class pyarr._sync.lidarr.release.Release(handler: RequestHandler)[source]

Release actions for Lidarr.

get(artist_id: int | None = None, album_id: int | None = None) list[dict[str, Any]][source]

Search indexers for specified fields.

Parameters:
  • artist_id (int | None, optional) – Artist ID from DB. Defaults to None.

  • album_id (int | None, optional) – Album ID from DB. Defaults to None.

Returns:

List of dictionaries with items.

Return type:

JsonArray

Manual Import

class pyarr._sync.lidarr.manual_import.ManualImport(handler: RequestHandler)[source]

Manual import actions for Lidarr.

get(folder: str, download_id: str | None = None, artist_id: int | None = None, filter_existing_files: bool = True, replace_existing_files: bool = True) list[dict[str, Any]][source]

Gets a manual import list.

Parameters:
  • folder (str) – Folder name.

  • download_id (str | None, optional) – Download ID. Defaults to None.

  • artist_id (int | None, optional) – Artist Database ID. Defaults to None.

  • filter_existing_files (bool, optional) – Filter files. Defaults to True.

  • replace_existing_files (bool, optional) – Replace files. Defaults to True.

Returns:

List of dictionaries with items.

Return type:

JsonArray

update(data: dict[str, Any]) dict[str, Any][source]

Update a manual import.

Parameters:

data (JsonObject) – Data containing changes.

Returns:

Dictionary of updated record.

Return type:

JsonObject