You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
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();
|
|
void DeleteForMovies(List<int> movieIds);
|
|
}
|
|
|
|
public class MediaFileRepository : BasicRepository<MovieFile>, IMediaFileRepository
|
|
{
|
|
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
|
: base(database, eventAggregator)
|
|
{
|
|
}
|
|
|
|
public List<MovieFile> GetFilesByMovie(int movieId)
|
|
{
|
|
return Query(x => x.MovieId == movieId);
|
|
}
|
|
|
|
public List<MovieFile> GetFilesWithoutMediaInfo()
|
|
{
|
|
return Query(x => x.MediaInfo == null);
|
|
}
|
|
|
|
public void DeleteForMovies(List<int> movieIds)
|
|
{
|
|
Delete(x => movieIds.Contains(x.MovieId));
|
|
}
|
|
}
|
|
}
|