New: Custom Formats

Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
Qstick
2022-01-23 23:42:41 -06:00
parent 4a3062deae
commit dbb6ef7664
185 changed files with 6974 additions and 810 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ namespace NzbDrone.Core.Parser.Model
public long Size { get; set; }
public DateTime Modified { get; set; }
public ParsedTrackInfo FileTrackInfo { get; set; }
public ParsedTrackInfo FolderTrackInfo { get; set; }
public ParsedBookInfo FolderTrackInfo { get; set; }
public ParsedBookInfo DownloadClientBookInfo { get; set; }
public List<string> AcoustIdResults { get; set; }
public Author Author { get; set; }
@@ -27,6 +27,7 @@ namespace NzbDrone.Core.Parser.Model
public bool AdditionalFile { get; set; }
public bool SceneSource { get; set; }
public string ReleaseGroup { get; set; }
public string SceneName { get; set; }
public override string ToString()
{
@@ -1,3 +1,5 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
using NzbDrone.Core.Qualities;
namespace NzbDrone.Core.Parser.Model
@@ -15,6 +17,10 @@ namespace NzbDrone.Core.Parser.Model
public string ReleaseGroup { get; set; }
public string ReleaseHash { get; set; }
public string ReleaseVersion { get; set; }
public string ReleaseTitle { get; set; }
[JsonIgnore]
public Dictionary<string, object> ExtraInfo { get; set; } = new Dictionary<string, object>();
public override string ToString()
{
+4 -1
View File
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Books;
using NzbDrone.Core.CustomFormats;
using NzbDrone.Core.Download.Clients;
namespace NzbDrone.Core.Parser.Model
@@ -14,11 +15,13 @@ namespace NzbDrone.Core.Parser.Model
public List<Book> Books { get; set; }
public bool DownloadAllowed { get; set; }
public TorrentSeedConfiguration SeedConfiguration { get; set; }
public int PreferredWordScore { get; set; }
public List<CustomFormat> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public RemoteBook()
{
Books = new List<Book>();
CustomFormats = new List<CustomFormat>();
}
public bool IsRecentBook()
+6 -3
View File
@@ -489,7 +489,7 @@ namespace NzbDrone.Core.Parser
Logger.Trace(regex);
try
{
var result = ParseBookMatchCollection(match);
var result = ParseBookMatchCollection(match, releaseTitle);
if (result != null)
{
@@ -780,7 +780,7 @@ namespace NzbDrone.Core.Parser
return parseResult.AuthorName;
}
private static ParsedBookInfo ParseBookMatchCollection(MatchCollection matchCollection)
private static ParsedBookInfo ParseBookMatchCollection(MatchCollection matchCollection, string releaseTitle)
{
var authorName = matchCollection[0].Groups["author"].Value.Replace('.', ' ').Replace('_', ' ');
var bookTitle = matchCollection[0].Groups["book"].Value.Replace('.', ' ').Replace('_', ' ');
@@ -794,7 +794,10 @@ namespace NzbDrone.Core.Parser
ParsedBookInfo result;
result = new ParsedBookInfo();
result = new ParsedBookInfo
{
ReleaseTitle = releaseTitle
};
result.AuthorName = authorName;
result.BookTitle = bookTitle;