mirror of https://github.com/Sonarr/Sonarr
56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Marr.Data;
|
|
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Qualities;
|
|
using NzbDrone.Core.Tv;
|
|
using NzbDrone.Core.MediaFiles.MediaInfo;
|
|
using NzbDrone.Common.Extensions;
|
|
using NzbDrone.Core.Languages;
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
{
|
|
public class EpisodeFile : ModelBase
|
|
{
|
|
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; }
|
|
public QualityModel Quality { get; set; }
|
|
public MediaInfoModel MediaInfo { get; set; }
|
|
public LazyLoaded<List<Episode>> Episodes { get; set; }
|
|
public LazyLoaded<Series> Series { get; set; }
|
|
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;
|
|
}
|
|
}
|
|
}
|