mirror of
https://github.com/Radarr/Radarr
synced 2026-01-29 02:42:14 +01:00
32 lines
906 B
C#
32 lines
906 B
C#
using System.Collections.Generic;
|
|
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
{
|
|
public interface IMediaFileRepository : IBasicRepository<MovieFile>
|
|
{
|
|
List<MovieFile> GetFilesByMovie(int movieId);
|
|
List<MovieFile> GetFilesWithoutMediaInfo();
|
|
}
|
|
|
|
|
|
public class MediaFileRepository : BasicRepository<MovieFile>, IMediaFileRepository
|
|
{
|
|
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
|
: base(database, eventAggregator)
|
|
{
|
|
}
|
|
|
|
public List<MovieFile> GetFilesByMovie(int movieId)
|
|
{
|
|
return Query(q => q.Where(c => c.MovieId == movieId).ToList());
|
|
}
|
|
|
|
public List<MovieFile> GetFilesWithoutMediaInfo()
|
|
{
|
|
return Query(q => q.Where(c => c.MediaInfo == null).ToList());
|
|
}
|
|
}
|
|
}
|