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.
50 lines
1.4 KiB
50 lines
1.4 KiB
8 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
6 years ago
|
using NzbDrone.Common.Extensions;
|
||
5 years ago
|
using NzbDrone.Core.Datastore;
|
||
|
using NzbDrone.Core.Music;
|
||
6 years ago
|
using NzbDrone.Core.Parser.Model;
|
||
5 years ago
|
using NzbDrone.Core.Qualities;
|
||
8 years ago
|
|
||
|
namespace NzbDrone.Core.MediaFiles
|
||
|
{
|
||
5 years ago
|
public class BookFile : ModelBase
|
||
8 years ago
|
{
|
||
6 years ago
|
// these are model properties
|
||
8 years ago
|
public string Path { get; set; }
|
||
|
public long Size { get; set; }
|
||
6 years ago
|
public DateTime Modified { get; set; }
|
||
8 years ago
|
public DateTime DateAdded { get; set; }
|
||
|
public string SceneName { get; set; }
|
||
|
public string ReleaseGroup { get; set; }
|
||
|
public QualityModel Quality { get; set; }
|
||
|
public MediaInfoModel MediaInfo { get; set; }
|
||
5 years ago
|
public int BookId { get; set; }
|
||
|
public int CalibreId { get; set; }
|
||
5 years ago
|
|
||
6 years ago
|
// These are queried from the database
|
||
5 years ago
|
public LazyLoaded<Author> Artist { get; set; }
|
||
|
public LazyLoaded<Book> Album { get; set; }
|
||
6 years ago
|
|
||
8 years ago
|
public override string ToString()
|
||
|
{
|
||
6 years ago
|
return string.Format("[{0}] {1}", Id, Path);
|
||
8 years ago
|
}
|
||
6 years ago
|
|
||
|
public string GetSceneOrFileName()
|
||
|
{
|
||
|
if (SceneName.IsNotNullOrWhiteSpace())
|
||
|
{
|
||
|
return SceneName;
|
||
|
}
|
||
|
|
||
|
if (Path.IsNotNullOrWhiteSpace())
|
||
|
{
|
||
|
return System.IO.Path.GetFileName(Path);
|
||
|
}
|
||
|
|
||
|
return string.Empty;
|
||
|
}
|
||
8 years ago
|
}
|
||
|
}
|