Sonarr/src/NzbDrone.Core/MediaFiles/EpisodeFile.cs

56 lines
1.6 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using Marr.Data;
2013-03-01 07:03:41 +00:00
using NzbDrone.Core.Datastore;
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;
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
{
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; }
public DateTime DateAdded { get; set; }
public string OriginalFilePath { get; set; }
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; }
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; }
public override string ToString()
{
return string.Format("[{0}] {1}", Id, RelativePath);
}
public string GetSceneOrFileName()
{
if (SceneName.IsNotNullOrWhiteSpace())
{
return SceneName;
}
if (RelativePath.IsNotNullOrWhiteSpace())
{
return System.IO.Path.GetFileNameWithoutExtension(RelativePath);
}
if (Path.IsNotNullOrWhiteSpace())
{
return System.IO.Path.GetFileNameWithoutExtension(Path);
}
return string.Empty;
}
2010-10-12 02:49:27 +00:00
}
}