2017-06-20 00:57:07 +00:00
|
|
|
|
using System;
|
2013-03-01 07:03:41 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NzbDrone.Core.Datastore;
|
2013-09-14 06:36:07 +00:00
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
2013-09-11 06:33:47 +00:00
|
|
|
|
|
2013-03-01 07:03:41 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
|
|
|
{
|
2017-05-11 18:43:05 +00:00
|
|
|
|
public interface IMediaFileRepository : IBasicRepository<TrackFile>
|
2013-03-01 07:03:41 +00:00
|
|
|
|
{
|
2017-06-20 00:57:07 +00:00
|
|
|
|
List<TrackFile> GetFilesByArtist(int artistId);
|
2017-05-11 18:43:05 +00:00
|
|
|
|
List<TrackFile> GetFilesWithoutMediaInfo();
|
2013-03-01 07:03:41 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2017-05-11 18:43:05 +00:00
|
|
|
|
public class MediaFileRepository : BasicRepository<TrackFile>, IMediaFileRepository
|
2013-03-01 07:03:41 +00:00
|
|
|
|
{
|
2015-05-03 19:46:21 +00:00
|
|
|
|
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
2013-09-14 06:36:07 +00:00
|
|
|
|
: base(database, eventAggregator)
|
2013-03-01 07:03:41 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-11 18:43:05 +00:00
|
|
|
|
public List<TrackFile> GetFilesWithoutMediaInfo()
|
2013-06-02 19:29:00 +00:00
|
|
|
|
{
|
2017-05-11 18:43:05 +00:00
|
|
|
|
return Query.Where(c => c.MediaInfo == null).ToList();
|
2013-03-01 07:03:41 +00:00
|
|
|
|
}
|
2014-04-10 17:58:50 +00:00
|
|
|
|
|
2017-06-20 00:57:07 +00:00
|
|
|
|
public List<TrackFile> GetFilesByArtist(int artistId)
|
2014-04-10 17:58:50 +00:00
|
|
|
|
{
|
2017-06-20 00:57:07 +00:00
|
|
|
|
return Query.Where(c => c.ArtistId == artistId).ToList();
|
2014-04-10 17:58:50 +00:00
|
|
|
|
}
|
2013-03-01 07:03:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|