mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-01-23 17:14:10 +00:00
33 lines
921 B
C#
33 lines
921 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using NzbDrone.Core.Datastore;
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
|
namespace NzbDrone.Core.MediaFiles
|
|
{
|
|
public interface IMediaFileRepository : IBasicRepository<TrackFile>
|
|
{
|
|
List<TrackFile> GetFilesByArtist(string artistId);
|
|
List<TrackFile> GetFilesWithoutMediaInfo();
|
|
}
|
|
|
|
|
|
public class MediaFileRepository : BasicRepository<TrackFile>, IMediaFileRepository
|
|
{
|
|
public MediaFileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
|
: base(database, eventAggregator)
|
|
{
|
|
}
|
|
|
|
public List<TrackFile> GetFilesWithoutMediaInfo()
|
|
{
|
|
return Query.Where(c => c.MediaInfo == null).ToList();
|
|
}
|
|
|
|
public List<TrackFile> GetFilesByArtist(string artistId)
|
|
{
|
|
return Query.Where(c => c.ForeignTrackId == artistId).ToList();
|
|
}
|
|
}
|
|
} |