jellyfin/jellyfin-plugin-reports

Incorrect argument type passed to IUserManager.GetUserById

oddstr13 opened this issue · 0 comments

Api/ReportsService.cs(111,94): error CS1503: Argument 1: cannot convert from 'string' to 'System.Guid' [/home/oddstr13/Projects/Jellyfin/Plugins/jellyfin-plugin-reports/Jellyfin.Plugin.Reports/Jellyfin.Plugin.Reports.csproj]
Api/ReportsService.cs(145,94): error CS1503: Argument 1: cannot convert from 'string' to 'System.Guid' [/home/oddstr13/Projects/Jellyfin/Plugins/jellyfin-plugin-reports/Jellyfin.Plugin.Reports/Jellyfin.Plugin.Reports.csproj]

IUserManager.GetUserById now takes Guid and not string.

Wrapping request.UserId in new Guid() makes the error go away, but I'm not sure if this is the correct way to do this.

var user = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;

var user = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;