Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lidarr - add_album throws errors #143

Closed
2 tasks done
marksie1988 opened this issue Apr 16, 2023 · 0 comments · Fixed by #144
Closed
2 tasks done

lidarr - add_album throws errors #143

marksie1988 opened this issue Apr 16, 2023 · 0 comments · Fixed by #144
Labels
type/bug Something isn't working

Comments

@marksie1988
Copy link
Collaborator

Is there an existing issue for this?

  • I have searched the existing issues

Current Behaviour

if lookup is used with a term instead of an ID the album cannot be added. Only when using the lookup with a musicbrainz id does it seem to work.

Steps To Reproduce

try to add an album with a lookup() using a search term

Expected behaviour

Album should be added without error

Pyarr Version

5.0.0

Python Version

3.11

Example Code

qual_profile = lidarr_client.get_quality_profile()
meta_profile = lidarr_client.get_metadata_profile()
items = lidarr_client.lookup("album name")
for item in items:
    if "album" in item:
        album = item["album"]
        data = lidarr_client.add_album(
            album=album,
            root_dir="/defaults/",
            quality_profile_id=qual_profile[0]["id"],
            metadata_profile_id=meta_profile[0]["id"],
            monitored=False,
            artist_monitor="latest",
            artist_search_for_missing_albums=False,
        )
    if item == items[-1]:
        print("none")

Relevant log output

{'message': 'Object reference not set to an instance of an object.', 'description': 'System.NullReferenceException: Object reference not set to an instance of an object.\n   at NzbDrone.Core.Music.AddAlbumService.AddAlbum(Album album, Boolean doRefresh) in D:\\a\\1\\s\\src\\NzbDrone.Core\\Music\\Services\\AddAlbumService.cs:line 54\n   at Lidarr.Api.V1.Albums.AlbumController.AddAlbum(AlbumResource albumResource) in D:\\a\\1\\s\\src\\Lidarr.Api.V1\\Albums\\AlbumController.cs:line 121\n   at lambda_method135(Closure , Object , Object[] )\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()\n--- End of stack trace from previous location ---\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)\n   at Lidarr.Http.Middleware.BufferingMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\BufferingMiddleware.cs:line 28\n   at Lidarr.Http.Middleware.IfModifiedMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\IfModifiedMiddleware.cs:line 41\n   at Lidarr.Http.Middleware.CacheHeaderMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\CacheHeaderMiddleware.cs:line 33\n   at Lidarr.Http.Middleware.StartingUpMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\StartingUpMiddleware.cs:line 38\n   at Lidarr.Http.Middleware.UrlBaseMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\UrlBaseMiddleware.cs:line 27\n   at Lidarr.Http.Middleware.VersionMiddleware.InvokeAsync(HttpContext context) in D:\\a\\1\\s\\src\\Lidarr.Http\\Middleware\\VersionMiddleware.cs:line 28\n   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)\n   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)\n   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)'}

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
1 participant