Almost everything working except importing episode thumbs

This commit is contained in:
Mark McDowall
2014-01-24 08:17:56 -08:00
parent a6361d0bbd
commit 3ca5e478ff
24 changed files with 509 additions and 174 deletions

View File

@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
@@ -9,6 +12,7 @@ namespace NzbDrone.Core.MediaFiles
{
List<EpisodeFile> GetFilesBySeries(int seriesId);
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
EpisodeFile FindFileByPath(string path, bool includeExtension = true);
}
@@ -31,5 +35,14 @@ namespace NzbDrone.Core.MediaFiles
.ToList();
}
public EpisodeFile FindFileByPath(string path, bool includeExtension = true)
{
if (includeExtension)
{
return Query.SingleOrDefault(c => c.Path == path);
}
return Query.SingleOrDefault(c => c.Path.StartsWith(Path.ChangeExtension(path, "")));
}
}
}