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
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
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
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