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()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var remoteAlbum = _parsingService.Map(parsedAlbumInfo);
|
||||||
|
|
||||||
|
if (remoteAlbum != null)
|
||||||
|
{
|
||||||
return new ParseResource
|
return new ParseResource
|
||||||
{
|
{
|
||||||
Title = title,
|
Title = title,
|
||||||
ParsedAlbumInfo = parsedEpisodeInfo
|
ParsedAlbumInfo = remoteAlbum.ParsedAlbumInfo,
|
||||||
|
Artist = remoteAlbum.Artist.ToResource(),
|
||||||
|
Albums = remoteAlbum.Albums.ToResource()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new ParseResource
|
||||||
|
{
|
||||||
|
Title = title,
|
||||||
|
ParsedAlbumInfo = parsedAlbumInfo
|
||||||
};
|
};
|
||||||
|
}
|
||||||
//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
|
|
||||||
// };
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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…
Reference in a new issue