2018-12-07 04:24:11 +00:00
|
|
|
using System;
|
2014-08-21 06:29:34 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using Marr.Data;
|
2013-03-01 07:03:41 +00:00
|
|
|
using NzbDrone.Core.Datastore;
|
2014-01-18 11:44:36 +00:00
|
|
|
using NzbDrone.Core.Qualities;
|
2013-03-01 07:03:41 +00:00
|
|
|
using NzbDrone.Core.Tv;
|
2014-04-10 17:58:50 +00:00
|
|
|
using NzbDrone.Core.MediaFiles.MediaInfo;
|
2017-07-29 16:28:17 +00:00
|
|
|
using NzbDrone.Common.Extensions;
|
2015-07-12 16:44:33 +00:00
|
|
|
using NzbDrone.Core.Languages;
|
2010-10-12 02:49:27 +00:00
|
|
|
|
2013-03-01 07:03:41 +00:00
|
|
|
namespace NzbDrone.Core.MediaFiles
|
2010-10-12 02:49:27 +00:00
|
|
|
{
|
2013-03-01 07:03:41 +00:00
|
|
|
public class EpisodeFile : ModelBase
|
2010-10-12 02:49:27 +00:00
|
|
|
{
|
2015-10-03 17:45:26 +00:00
|
|
|
public int SeriesId { get; set; }
|
|
|
|
public int SeasonNumber { get; set; }
|
|
|
|
public string RelativePath { get; set; }
|
|
|
|
public string Path { get; set; }
|
|
|
|
public long Size { get; set; }
|
2010-10-21 01:49:23 +00:00
|
|
|
public DateTime DateAdded { get; set; }
|
2018-12-07 04:24:11 +00:00
|
|
|
public string OriginalFilePath { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public string SceneName { get; set; }
|
|
|
|
public string ReleaseGroup { get; set; }
|
2013-04-01 06:22:16 +00:00
|
|
|
public QualityModel Quality { get; set; }
|
2014-04-10 17:58:50 +00:00
|
|
|
public MediaInfoModel MediaInfo { get; set; }
|
2014-08-21 06:29:34 +00:00
|
|
|
public LazyLoaded<List<Episode>> Episodes { get; set; }
|
|
|
|
public LazyLoaded<Series> Series { get; set; }
|
2015-07-12 16:44:33 +00:00
|
|
|
public Language Language { get; set; }
|
2013-07-16 02:56:46 +00:00
|
|
|
|
2015-10-03 17:45:26 +00:00
|
|
|
public override string ToString()
|
2013-07-16 02:56:46 +00:00
|
|
|
{
|
2015-10-03 17:45:26 +00:00
|
|
|
return string.Format("[{0}] {1}", Id, RelativePath);
|
2013-07-16 02:56:46 +00:00
|
|
|
}
|
2017-07-29 16:28:17 +00:00
|
|
|
|
|
|
|
public string GetSceneOrFileName()
|
|
|
|
{
|
|
|
|
if (SceneName.IsNotNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
return SceneName;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RelativePath.IsNotNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
return System.IO.Path.GetFileName(RelativePath);
|
|
|
|
}
|
|
|
|
|
2018-10-20 20:27:51 +00:00
|
|
|
if (Path.IsNotNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
return System.IO.Path.GetFileName(Path);
|
|
|
|
}
|
|
|
|
|
2017-07-29 16:28:17 +00:00
|
|
|
return string.Empty;
|
|
|
|
}
|
2010-10-12 02:49:27 +00:00
|
|
|
}
|
2017-07-29 16:28:17 +00:00
|
|
|
}
|