mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Fixes for sonarr, we now display the error messages back to the user
This commit is contained in:
parent
3efd54c1b6
commit
10be8f0440
7 changed files with 55 additions and 16 deletions
|
@ -24,8 +24,10 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
using System.Linq;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Nancy.Validation;
|
||||
|
||||
|
||||
|
@ -55,5 +57,31 @@ namespace PlexRequests.UI.Helpers
|
|||
})
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
public static JsonResponseModel SendSonarrError(List<string> result)
|
||||
{
|
||||
var model = new JsonResponseModel {Result = false};
|
||||
if (!result.Any())
|
||||
{
|
||||
return model;
|
||||
}
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine("Errors from Sonarr: ");
|
||||
for (var i = 0; i < result.Count; i++)
|
||||
{
|
||||
if (i != result.Count - 1)
|
||||
{
|
||||
sb.AppendLine(result[i] + ",");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine(result[i]);
|
||||
}
|
||||
}
|
||||
|
||||
model.Message = sb.ToString();
|
||||
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue