Fixed: Parse endpoint not correctly parsing releases

pull/6/head
Qstick 6 years ago
parent 8befd77f0f
commit 0926862609

@ -20,40 +20,33 @@ namespace Lidarr.Api.V1.Parse
private ParseResource Parse() private ParseResource Parse()
{ {
var title = Request.Query.Title.Value as string; var title = Request.Query.Title.Value as string;
var path = Request.Query.Path.Value as string; var parsedAlbumInfo = Parser.ParseAlbumTitle(title);
var parsedEpisodeInfo = path.IsNotNullOrWhiteSpace() ? Parser.ParseMusicPath(path) : Parser.ParseMusicTitle(title);
if (parsedEpisodeInfo == null) if (parsedAlbumInfo == null)
{ {
return null; return null;
} }
return new ParseResource var remoteAlbum = _parsingService.Map(parsedAlbumInfo);
{
Title = title,
ParsedAlbumInfo = parsedEpisodeInfo
};
//var remoteEpisode = null //_parsingService.Map(parsedEpisodeInfo, 0, 0);
//if (remoteEpisode != null) if (remoteAlbum != null)
//{ {
// return new ParseResource return new ParseResource
// { {
// Title = title, Title = title,
// ParsedAlbumInfo = remoteEpisode.ParsedEpisodeInfo, ParsedAlbumInfo = remoteAlbum.ParsedAlbumInfo,
// Artist = remoteEpisode.Series.ToResource(), Artist = remoteAlbum.Artist.ToResource(),
// Albums = remoteEpisode.Episodes.ToResource() Albums = remoteAlbum.Albums.ToResource()
// }; };
//} }
//else else
//{ {
// return new ParseResource return new ParseResource
// { {
// Title = title, Title = title,
// ParsedAlbumInfo = parsedEpisodeInfo ParsedAlbumInfo = parsedAlbumInfo
// }; };
//} }
} }
} }
} }

@ -9,7 +9,7 @@ namespace Lidarr.Api.V1.Parse
public class ParseResource : RestResource public class ParseResource : RestResource
{ {
public string Title { get; set; } public string Title { get; set; }
public ParsedTrackInfo ParsedAlbumInfo { get; set; } public ParsedAlbumInfo ParsedAlbumInfo { get; set; }
public ArtistResource Artist { get; set; } public ArtistResource Artist { get; set; }
public List<AlbumResource> Albums { get; set; } public List<AlbumResource> Albums { get; set; }
} }

Loading…
Cancel
Save