mirror of https://github.com/Radarr/Radarr
some changes to unmapped view
This commit is contained in:
parent
16fcda18c3
commit
bfef6166f5
|
@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test
|
|||
var unmappedFolder = seriesController.GetUnmappedFolders();
|
||||
|
||||
//Assert
|
||||
Assert.AreElementsEqualIgnoringOrder(MockLib.StandardSeries, unmappedFolder);
|
||||
Assert.AreElementsEqualIgnoringOrder(MockLib.StandardSeries, unmappedFolder.Values);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
TvdbSeries MapPathToSeries(string path);
|
||||
void AddSeries(string path, TvdbSeries series);
|
||||
List<String> GetUnmappedFolders();
|
||||
Dictionary<Guid, String> GetUnmappedFolders();
|
||||
Series FindSeries(string cleanTitle);
|
||||
bool QualityWanted(int seriesId, QualityTypes quality);
|
||||
}
|
||||
|
|
|
@ -58,19 +58,19 @@ namespace NzbDrone.Core.Providers
|
|||
return _sonioRepo.Exists<Series>(s => s.SeriesId == seriesId && (QualityTypes)s.Quality == quality);
|
||||
}
|
||||
|
||||
public List<String> GetUnmappedFolders()
|
||||
public Dictionary<Guid, String> GetUnmappedFolders()
|
||||
{
|
||||
Logger.Debug("Generating list of unmapped folders");
|
||||
if (String.IsNullOrEmpty(_config.SeriesRoot))
|
||||
throw new InvalidOperationException("TV Series folder is not configured yet.");
|
||||
|
||||
var results = new List<String>();
|
||||
var results = new Dictionary<Guid, String>();
|
||||
foreach (string seriesFolder in _diskProvider.GetDirectories(_config.SeriesRoot))
|
||||
{
|
||||
var cleanPath = Parser.NormalizePath(new DirectoryInfo(seriesFolder).FullName);
|
||||
if (!_sonioRepo.Exists<Series>(s => s.Path == cleanPath))
|
||||
{
|
||||
results.Add(cleanPath);
|
||||
results.Add(Guid.NewGuid(), cleanPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace NzbDrone.Core.Providers
|
|||
var unmappedFolders = _seriesProvider.GetUnmappedFolders();
|
||||
_seriesSyncNotification.ProgressMax = unmappedFolders.Count;
|
||||
|
||||
foreach (string seriesFolder in unmappedFolders)
|
||||
foreach (string seriesFolder in unmappedFolders.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace NzbDrone.Web.Controllers
|
|||
|
||||
public ActionResult UnMapped()
|
||||
{
|
||||
return View(_seriesProvider.GetUnmappedFolders());
|
||||
return View(_seriesProvider.GetUnmappedFolders().Select(c => new MappingModel() { Id = 1, Path = c.Value }).ToList());
|
||||
}
|
||||
|
||||
|
||||
|
@ -156,6 +156,14 @@ namespace NzbDrone.Web.Controllers
|
|||
//
|
||||
// GET: /Series/Details/5
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Post)]
|
||||
[GridAction]
|
||||
public ActionResult _SaveAjaxEditing(string id)
|
||||
{
|
||||
return RedirectToAction("UnMapped");
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Details(int seriesId)
|
||||
{
|
||||
return View(_seriesProvider.GetSeries(seriesId));
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
</Compile>
|
||||
<Compile Include="Helpers\IsCurrentActionHelper.cs" />
|
||||
<Compile Include="Models\AccountModels.cs" />
|
||||
<Compile Include="Models\MappingModel.cs" />
|
||||
<Compile Include="Models\EpisodeModel.cs" />
|
||||
<Compile Include="Models\QualityModel.cs" />
|
||||
<Compile Include="Models\SettingsModels.cs" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<String>>" %>
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<NzbDrone.Web.Models.MappingModel>>" %>
|
||||
|
||||
<%@ Import Namespace="Telerik.Web.Mvc.UI" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
||||
|
@ -10,13 +10,19 @@
|
|||
<h3>
|
||||
Please Re-sync your folders. If the problem persists try renaming your folders to
|
||||
something more similar to the name of series they contain.</h3>
|
||||
<%
|
||||
|
||||
|
||||
Html.Telerik().Grid(Model)
|
||||
.Name("Grid")
|
||||
.Columns(columns => columns.Bound(o => o).Title("Folder"))
|
||||
.Sortable(sort => sort.OrderBy(order => order.Add(o => o).Ascending()).Enabled(false))
|
||||
.Render();
|
||||
<%= Html.Telerik().Grid(Model)
|
||||
.Name("Grid")
|
||||
.DataKeys(dataKeys => dataKeys.Add(c => c.Id))
|
||||
.DataBinding(dataBinding => dataBinding
|
||||
//Server binding
|
||||
.Ajax()
|
||||
.Select("UnMapped", "Series")
|
||||
.Update("Update", "Home")
|
||||
)
|
||||
.Columns(columns =>
|
||||
{
|
||||
columns.Bound(c => c.Path);
|
||||
columns.Command(commands => commands.Edit());
|
||||
})
|
||||
%>
|
||||
</asp:Content>
|
||||
|
|
Loading…
Reference in New Issue