mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Manage multiple Tv Root Folders in Settings/General.
Start of AddExisting.
This commit is contained in:
parent
2e9dd7f1ff
commit
2871723bfe
21 changed files with 381 additions and 90 deletions
43
NzbDrone.Core/Providers/RootDirProvider.cs
Normal file
43
NzbDrone.Core/Providers/RootDirProvider.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NzbDrone.Core.Repository;
|
||||
using SubSonic.Repository;
|
||||
|
||||
namespace NzbDrone.Core.Providers
|
||||
{
|
||||
public class RootDirProvider : IRootDirProvider
|
||||
{
|
||||
private readonly IRepository _sonioRepo;
|
||||
|
||||
public RootDirProvider(IRepository sonicRepo)
|
||||
{
|
||||
_sonioRepo = sonicRepo;
|
||||
}
|
||||
|
||||
#region IRootDirProvider
|
||||
|
||||
public List<RootDir> GetAll()
|
||||
{
|
||||
return _sonioRepo.All<RootDir>().ToList();
|
||||
}
|
||||
|
||||
public void Add(RootDir rootDir)
|
||||
{
|
||||
_sonioRepo.Add(rootDir);
|
||||
}
|
||||
|
||||
public void Remove(int rootDirId)
|
||||
{
|
||||
_sonioRepo.Delete<RootDir>(rootDirId);
|
||||
}
|
||||
|
||||
public void Update(RootDir rootDir)
|
||||
{
|
||||
_sonioRepo.Update(rootDir);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue