mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-17 21:25:39 -04:00
Almost everything working except importing episode thumbs
This commit is contained in:
@@ -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, "")));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user