You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Core/Parser/Model/RemoteBook.cs

49 lines
1.3 KiB

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
{
public class RemoteBook
{
public ReleaseInfo Release { get; set; }
public ParsedBookInfo ParsedBookInfo { get; set; }
public Author Author { get; set; }
public List<Book> Books { get; set; }
public bool DownloadAllowed { get; set; }
public TorrentSeedConfiguration SeedConfiguration { get; set; }
public List<CustomFormat> CustomFormats { get; set; }
public int CustomFormatScore { get; set; }
public ReleaseSourceType ReleaseSource { get; set; }
public RemoteBook()
{
Books = new List<Book>();
CustomFormats = new List<CustomFormat>();
}
public bool IsRecentBook()
{
return Books.Any(e => e.ReleaseDate >= DateTime.UtcNow.Date.AddDays(-14));
}
public override string ToString()
{
return Release.Title;
}
}
public enum ReleaseSourceType
{
Unknown = 0,
Rss = 1,
Search = 2,
UserInvokedSearch = 3,
InteractiveSearch = 4,
ReleasePush = 5
}
}