mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
moved rootdir to eloquera
This commit is contained in:
parent
0155de4d92
commit
9e4bb278ef
35 changed files with 398 additions and 565 deletions
46
NzbDrone.Core/RootFolders/RootFolderRepository.cs
Normal file
46
NzbDrone.Core/RootFolders/RootFolderRepository.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Repository;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Core.RootFolders
|
||||
{
|
||||
public interface IRootFolderRepository
|
||||
{
|
||||
List<RootDir> All();
|
||||
RootDir Get(int rootFolderId);
|
||||
RootDir Add(RootDir rootFolder);
|
||||
void Delete(int rootFolderId);
|
||||
}
|
||||
|
||||
public class RootFolderRepository : IRootFolderRepository
|
||||
{
|
||||
private readonly EloqueraDb _db;
|
||||
|
||||
public RootFolderRepository(EloqueraDb db)
|
||||
{
|
||||
_db = db;
|
||||
}
|
||||
|
||||
public List<RootDir> All()
|
||||
{
|
||||
return _db.AsQueryable<RootDir>().ToList();
|
||||
}
|
||||
|
||||
public RootDir Get(int rootFolderId)
|
||||
{
|
||||
return _db.AsQueryable<RootDir>().Single(c => c.Id == rootFolderId);
|
||||
}
|
||||
|
||||
public RootDir Add(RootDir rootFolder)
|
||||
{
|
||||
return _db.Insert(rootFolder);
|
||||
}
|
||||
|
||||
public void Delete(int rootFolderId)
|
||||
{
|
||||
_db.Delete(Get(rootFolderId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue