mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-25 11:13:39 +02:00
Updated series grid
Added some parser tests
This commit is contained in:
parent
f7de28b1bb
commit
9d7ed33d0d
@ -179,8 +179,9 @@ namespace NzbDrone.Core.Test
|
|||||||
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
|
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase("simpsons",21,23)]
|
||||||
public void newzbin_search_returns_valid_results()
|
[TestCase("Hawaii Five-0", 1, 5)]
|
||||||
|
public void newzbin_search_returns_valid_results(string title, int season, int episode)
|
||||||
{
|
{
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
|
|
||||||
@ -194,12 +195,12 @@ namespace NzbDrone.Core.Test
|
|||||||
|
|
||||||
mocker.Resolve<HttpProvider>();
|
mocker.Resolve<HttpProvider>();
|
||||||
|
|
||||||
var result = mocker.Resolve<Newzbin>().FetchEpisode("Simpsons", 21, 23);
|
var result = mocker.Resolve<Newzbin>().FetchEpisode(title, season, episode);
|
||||||
|
|
||||||
result.Should().NotBeEmpty();
|
result.Should().NotBeEmpty();
|
||||||
result.Should().OnlyContain(r => r.CleanTitle == "simpsons");
|
result.Should().OnlyContain(r => r.CleanTitle == title);
|
||||||
result.Should().OnlyContain(r => r.SeasonNumber == 21);
|
result.Should().OnlyContain(r => r.SeasonNumber == season);
|
||||||
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
|
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(episode));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -41,6 +41,8 @@ namespace NzbDrone.Core.Test
|
|||||||
[TestCase(@"24-7 Penguins-Capitals- Road to the NHL Winter Classic - S01E03 - Episode 3.mkv", "24-7 Penguins-Capitals- Road to the NHL Winter Classic", 1, 3)]
|
[TestCase(@"24-7 Penguins-Capitals- Road to the NHL Winter Classic - S01E03 - Episode 3.mkv", "24-7 Penguins-Capitals- Road to the NHL Winter Classic", 1, 3)]
|
||||||
[TestCase("Adventure.Inc.S03E19.DVDRip.\"XviD\"-OSiTV", "Adventure.Inc", 3, 19)]
|
[TestCase("Adventure.Inc.S03E19.DVDRip.\"XviD\"-OSiTV", "Adventure.Inc", 3, 19)]
|
||||||
[TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", "Chuck", 4, 5)]
|
[TestCase("C:/Test/TV/Chuck.4x05.HDTV.XviD-LOL", "Chuck", 4, 5)]
|
||||||
|
[TestCase("Hawaii Five-0 (2010) - 1x05 - Nalowale (Forgotten/Missing)", "Hawaii Five-0 (2010)", 1, 5)]
|
||||||
|
[TestCase("Hawaii Five-0 (2010) - 1x05 - Title", "Hawaii Five-0 (2010)", 1, 5)]
|
||||||
public void episode_parse(string postTitle, string title, int season, int episode)
|
public void episode_parse(string postTitle, string title, int season, int episode)
|
||||||
{
|
{
|
||||||
var result = Parser.ParseEpisodeInfo(postTitle);
|
var result = Parser.ParseEpisodeInfo(postTitle);
|
||||||
@ -202,6 +204,7 @@ namespace NzbDrone.Core.Test
|
|||||||
[TestCase("CaPitAl", "capital")]
|
[TestCase("CaPitAl", "capital")]
|
||||||
[TestCase("peri.od", "period")]
|
[TestCase("peri.od", "period")]
|
||||||
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
[TestCase("this.^&%^**$%@#$!That", "thisthat")]
|
||||||
|
[TestCase("test/test", "testtest")]
|
||||||
public void Normalize_Title(string dirty, string clean)
|
public void Normalize_Title(string dirty, string clean)
|
||||||
{
|
{
|
||||||
var result = Parser.NormalizeTitle(dirty);
|
var result = Parser.NormalizeTitle(dirty);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
@{Html.Telerik().ComboBox()
|
@{Html.Telerik().ComboBox()
|
||||||
.Name("path_" + ViewData["guid"])
|
.Name("path_" + ViewData["guid"])
|
||||||
.BindTo(Model.SelectList)
|
.BindTo(Model.SelectList)
|
||||||
.DataBinding(binding => binding.Ajax().Select("_autoCompletePath", "Directory").Delay(400).Cache(false))
|
.DataBinding(binding => binding.Ajax().Select("_autoCompletePath", "Directory").Delay(400).Cache(true))
|
||||||
.Filterable(f => f.FilterMode(AutoCompleteFilterMode.StartsWith))
|
.Filterable(f => f.FilterMode(AutoCompleteFilterMode.StartsWith))
|
||||||
.HighlightFirstMatch(true)
|
.HighlightFirstMatch(true)
|
||||||
.HtmlAttributes(new { style = "width: 300px;" })
|
.HtmlAttributes(new { style = "width: 300px;" })
|
||||||
|
@ -1,41 +1,20 @@
|
|||||||
@using NzbDrone.Core.Repository;
|
@using NzbDrone.Core.Repository;
|
||||||
@using NzbDrone.Web.Models;
|
@using NzbDrone.Web.Models;
|
||||||
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
@model IEnumerable<NzbDrone.Core.Repository.Series>
|
||||||
|
|
||||||
@section TitleContent{
|
@section TitleContent{
|
||||||
Series
|
Series
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* progress bar container */
|
/* progress bar container */
|
||||||
.progressbar
|
.progressbar
|
||||||
{
|
{
|
||||||
border:1px solid grey;
|
border: 1px solid #065EFE;
|
||||||
-khtml-border-radius:8px;
|
|
||||||
border-radius:8px;
|
|
||||||
-moz-border-radius:8px;
|
|
||||||
-webkit-border-radius:8px;
|
|
||||||
width: 125px;
|
width: 125px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* apply curves to the progress bar */
|
|
||||||
.progress
|
|
||||||
{
|
|
||||||
-khtml-border-top-left-radius:7px;
|
|
||||||
border-top-left-radius:7px;
|
|
||||||
-moz-border-top-left-radius:7px;
|
|
||||||
-webkit-border-top-left-radius:7px;
|
|
||||||
|
|
||||||
-khtml-border-bottom-left-radius:7px;
|
|
||||||
border-bottom-left-radius:7px;
|
|
||||||
-moz-border-bottom-left-radius:7px;
|
|
||||||
-webkit-border-bottom-left-radius:7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* color bar */
|
/* color bar */
|
||||||
.progressbar div.progress
|
.progressbar div.progress
|
||||||
@ -47,24 +26,24 @@
|
|||||||
background-color: #065EFE;
|
background-color: #065EFE;
|
||||||
}
|
}
|
||||||
/* text on bar */
|
/* text on bar */
|
||||||
.progressbar div.progress .progressText{
|
.progressbar div.progress .progressText
|
||||||
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
/* text off bar */
|
/* text off bar */
|
||||||
.progressbar div.progressText{
|
.progressbar div.progressText
|
||||||
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@section ActionMenu{
|
@section ActionMenu{
|
||||||
@{Html.RenderPartial("SubMenu");}
|
@{Html.RenderPartial("SubMenu");}
|
||||||
}
|
}
|
||||||
|
|
||||||
@section MainContent{
|
@section MainContent{
|
||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
@{Html.Telerik().Grid<SeriesModel>().Name("Grid")
|
||||||
@ -76,6 +55,12 @@
|
|||||||
.Delete("_DeleteAjaxSeriesEditing", "Series"))
|
.Delete("_DeleteAjaxSeriesEditing", "Series"))
|
||||||
.Columns(columns =>
|
.Columns(columns =>
|
||||||
{
|
{
|
||||||
|
columns.Command(commands =>
|
||||||
|
{
|
||||||
|
commands.Edit().ButtonType(GridButtonType.Image);
|
||||||
|
commands.Delete().ButtonType(GridButtonType.Image);
|
||||||
|
}).Title("Actions").Width(80);
|
||||||
|
|
||||||
columns.Bound(o => o.Title)
|
columns.Bound(o => o.Title)
|
||||||
.ClientTemplate("<a href=" +
|
.ClientTemplate("<a href=" +
|
||||||
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
Url.Action("Details", "Series", new { seriesId = "<#= SeriesId #>" }) +
|
||||||
@ -91,28 +76,25 @@
|
|||||||
"<span class=\"progressText\" style=\"width: 125px;\"></span>" +
|
"<span class=\"progressText\" style=\"width: 125px;\"></span>" +
|
||||||
"</div>" +
|
"</div>" +
|
||||||
"</div>");
|
"</div>");
|
||||||
columns.Bound(o => o.Path);
|
|
||||||
columns.Command(commands =>
|
|
||||||
{
|
|
||||||
commands.Edit().ButtonType(GridButtonType.Image);
|
|
||||||
commands.Delete().ButtonType(GridButtonType.Image);
|
|
||||||
}).Title("Actions").Width(80);
|
|
||||||
|
|
||||||
})
|
})
|
||||||
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
.Editable(editor => editor.Mode(GridEditMode.PopUp))
|
||||||
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
|
.Sortable(sort => sort.OrderBy(order => order.Add(o => o.Title).Ascending()).Enabled(true))
|
||||||
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
|
.DetailView(detailView => detailView.ClientTemplate("<div style=\"width:95%\"><#= Overview #></div>"))
|
||||||
.ClientEvents(clientEvents => { clientEvents.OnEdit("grid_edit");
|
.ClientEvents(clientEvents =>
|
||||||
|
{
|
||||||
|
clientEvents.OnEdit("grid_edit");
|
||||||
clientEvents.OnSave("grid_save");
|
clientEvents.OnSave("grid_save");
|
||||||
clientEvents.OnDataBinding("grid_bind");
|
clientEvents.OnDataBinding("grid_bind");
|
||||||
clientEvents.OnDataBound("grid_bound");
|
clientEvents.OnDataBound("grid_bound");
|
||||||
clientEvents.OnRowDataBound("grid_rowBound");
|
clientEvents.OnRowDataBound("grid_rowBound");
|
||||||
})
|
})
|
||||||
.Render();}
|
.Render();}
|
||||||
<span class="grid-loader"><img src="@Url.Content( "~/Content/Images/Loading.gif" )" alt="Loading"/> Loading...</span>
|
<span class="grid-loader">
|
||||||
|
<img src="@Url.Content("~/Content/Images/Loading.gif")" alt="Loading"/>
|
||||||
|
Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var windowElement;
|
var windowElement;
|
||||||
|
|
||||||
@ -163,7 +145,6 @@
|
|||||||
$("#progressbar_" + seriesId).episodeProgress(episodeFileCount, episodeCount);
|
$("#progressbar_" + seriesId).episodeProgress(episodeFileCount, episodeCount);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../Scripts/doTimeout.js"></script>
|
<script type="text/javascript" src="../../Scripts/doTimeout.js"></script>
|
||||||
<script>
|
<script>
|
||||||
(function ($) {
|
(function ($) {
|
||||||
@ -177,17 +158,7 @@
|
|||||||
|
|
||||||
progressBar.css("width", width + "%");
|
progressBar.css("width", width + "%");
|
||||||
|
|
||||||
if (width > 97) {
|
|
||||||
progressBar.css("-khtml-border-top-right-radius", "7px");
|
|
||||||
progressBar.css("border-top-right-radius", "7px");
|
|
||||||
progressBar.css("-moz-border-top-right-radius", "7px");
|
|
||||||
progressBar.css("-webkit-border-top-right-radius", "7px");
|
|
||||||
|
|
||||||
progressBar.css("-khtml-border-bottom-right-radius", "7px");
|
|
||||||
progressBar.css("border-bottom-right-radius", "7px");
|
|
||||||
progressBar.css("-moz-border-bottom-right-radius", "7px");
|
|
||||||
progressBar.css("-webkit-border-bottom-right-radius", "7px");
|
|
||||||
}
|
|
||||||
|
|
||||||
div.find(".progressText").html(episodes + " / " + totalEpisodes);
|
div.find(".progressText").html(episodes + " / " + totalEpisodes);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user