mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 15:52:42 +00:00
Fixed: Parse endpoint not correctly parsing releases
This commit is contained in:
parent
8befd77f0f
commit
0926862609
2 changed files with 22 additions and 29 deletions
|
@ -20,40 +20,33 @@ public ParseModule(IParsingService parsingService)
|
|||
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…
Reference in a new issue