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()
{
var title = Request.Query.Title.Value as string;
var path = Request.Query.Path.Value as string;
var parsedEpisodeInfo = path.IsNotNullOrWhiteSpace() ? Parser.ParseMusicPath(path) : Parser.ParseMusicTitle(title);
var parsedAlbumInfo = Parser.ParseAlbumTitle(title);
if (parsedEpisodeInfo == null)
if (parsedAlbumInfo == null)
{
return null;
}
var remoteAlbum = _parsingService.Map(parsedAlbumInfo);
if (remoteAlbum != null)
{
return new ParseResource
{
Title = title,
ParsedAlbumInfo = parsedEpisodeInfo
ParsedAlbumInfo = remoteAlbum.ParsedAlbumInfo,
Artist = remoteAlbum.Artist.ToResource(),
Albums = remoteAlbum.Albums.ToResource()
};
//var remoteEpisode = null //_parsingService.Map(parsedEpisodeInfo, 0, 0);
//if (remoteEpisode != null)
//{
// return new ParseResource
// {
// Title = title,
// ParsedAlbumInfo = remoteEpisode.ParsedEpisodeInfo,
// Artist = remoteEpisode.Series.ToResource(),
// Albums = remoteEpisode.Episodes.ToResource()
// };
//}
//else
//{
// return new ParseResource
// {
// Title = title,
// ParsedAlbumInfo = parsedEpisodeInfo
// };
//}
}
else
{
return new ParseResource
{
Title = title,
ParsedAlbumInfo = parsedAlbumInfo
};
}
}
}
}

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

Loading…
Cancel
Save