mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-10 04:52:42 +01:00
Added metadata options to settings #ND-21
New: Metadata file creation for XBMC
This commit is contained in:
parent
2e9cf66b57
commit
5c49ac6b29
@ -501,20 +501,6 @@ public virtual string PlexPassword
|
||||
set { SetValue("PlexPassword", value); }
|
||||
}
|
||||
|
||||
public virtual Boolean MetadataEnabled
|
||||
{
|
||||
get { return GetValueBoolean("MetadataEnabled"); }
|
||||
|
||||
set { SetValue("MetadataEnabled", value); }
|
||||
}
|
||||
|
||||
public virtual Boolean MetadataXbmcEnabled
|
||||
{
|
||||
get { return GetValueBoolean("MetadataXbmcEnabled"); }
|
||||
|
||||
set { SetValue("MetadataXbmcEnabled", value); }
|
||||
}
|
||||
|
||||
public virtual Boolean MetadataUseBanners
|
||||
{
|
||||
get { return GetValueBoolean("MetadataUseBanners"); }
|
||||
|
@ -31,17 +31,19 @@ public class SettingsController : Controller
|
||||
private readonly QualityTypeProvider _qualityTypeProvider;
|
||||
private readonly ConfigFileProvider _configFileProvider;
|
||||
private readonly NewznabProvider _newznabProvider;
|
||||
private readonly MetadataProvider _metadataProvider;
|
||||
|
||||
public SettingsController(ConfigProvider configProvider, IndexerProvider indexerProvider,
|
||||
QualityProvider qualityProvider, AutoConfigureProvider autoConfigureProvider,
|
||||
SeriesProvider seriesProvider, ExternalNotificationProvider externalNotificationProvider,
|
||||
QualityTypeProvider qualityTypeProvider,
|
||||
ConfigFileProvider configFileProvider, NewznabProvider newznabProvider)
|
||||
QualityTypeProvider qualityTypeProvider, ConfigFileProvider configFileProvider,
|
||||
NewznabProvider newznabProvider, MetadataProvider metadataProvider)
|
||||
{
|
||||
_externalNotificationProvider = externalNotificationProvider;
|
||||
_qualityTypeProvider = qualityTypeProvider;
|
||||
_configFileProvider = configFileProvider;
|
||||
_newznabProvider = newznabProvider;
|
||||
_metadataProvider = metadataProvider;
|
||||
_configProvider = configProvider;
|
||||
_indexerProvider = indexerProvider;
|
||||
_qualityProvider = qualityProvider;
|
||||
@ -208,6 +210,10 @@ public ActionResult Naming()
|
||||
model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name");
|
||||
model.MultiEpisodeStyles = new SelectList(EpisodeSortingHelper.GetMultiEpisodeStyles(), "Id", "Name");
|
||||
|
||||
//Metadata
|
||||
model.MetadataXbmcEnabled = _metadataProvider.GetSettings(typeof(Core.Providers.Metadata.Xbmc)).Enable;
|
||||
model.MetadataUseBanners = _configProvider.MetadataUseBanners;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@ -589,6 +595,14 @@ public JsonResult SaveNaming(EpisodeNamingModel data)
|
||||
_configProvider.SortingNumberStyle = data.NumberStyle;
|
||||
_configProvider.SortingMultiEpisodeStyle = data.MultiEpisodeStyle;
|
||||
|
||||
//Metadata
|
||||
_configProvider.MetadataUseBanners = data.MetadataUseBanners;
|
||||
|
||||
//Xbmc
|
||||
var xbmc = _metadataProvider.GetSettings(typeof(Core.Providers.Metadata.Xbmc));
|
||||
xbmc.Enable = data.MetadataXbmcEnabled;
|
||||
_metadataProvider.SaveSettings(xbmc);
|
||||
|
||||
return GetSuccessResult();
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,14 @@ public class EpisodeNamingModel
|
||||
[Description("How will multi-episode files be named?")]
|
||||
public int MultiEpisodeStyle { get; set; }
|
||||
|
||||
[DisplayName("XBMC")]
|
||||
[Description("Enable creating metadata for XBMC")]
|
||||
public bool MetadataXbmcEnabled { get; set; }
|
||||
|
||||
[DisplayName("Use Banners")]
|
||||
[Description("Use banners instead of posters?")]
|
||||
public bool MetadataUseBanners { get; set; }
|
||||
|
||||
public SelectList SeparatorStyles { get; set; }
|
||||
public SelectList NumberStyles { get; set; }
|
||||
public SelectList MultiEpisodeStyles { get; set; }
|
||||
|
@ -543,6 +543,12 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\System\Stats.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Settings\EpisodeNamingPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Settings\MetadataPartial.cshtml" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
53
NzbDrone.Web/Views/Settings/EpisodeNamingPartial.cshtml
Normal file
53
NzbDrone.Web/Views/Settings/EpisodeNamingPartial.cshtml
Normal file
@ -0,0 +1,53 @@
|
||||
@using NzbDrone.Web.Helpers
|
||||
@model NzbDrone.Web.Models.EpisodeNamingModel
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<div class="settingsContainer">
|
||||
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeriesName)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeriesName)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.SeriesName, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.EpisodeName)
|
||||
<span class="small">@Html.DescriptionFor(m => m.EpisodeName)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.EpisodeName, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.ReplaceSpaces)
|
||||
<span class="small">@Html.DescriptionFor(m => m.ReplaceSpaces)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.ReplaceSpaces, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.AppendQuality)
|
||||
<span class="small">@Html.DescriptionFor(m => m.AppendQuality)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.AppendQuality, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolders)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeasonFolders)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.SeasonFolders, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolderFormat)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeasonFolderFormat)</span>
|
||||
</label>
|
||||
@Html.TextBoxFor(m => m.SeasonFolderFormat, new { @class = "inputClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeparatorStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeparatorStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles, new { @class = "inputClass selectClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.NumberStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.NumberStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles, new { @class = "inputClass selectClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.MultiEpisodeStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles, new { @class = "inputClass selectClass" })
|
||||
</div>
|
||||
<div id="examples">
|
||||
<div id="singleEpisodeExample">
|
||||
<b>Single Episode Example: </b><span class="result"></span>
|
||||
</div>
|
||||
<div id="multiEpisodeExample">
|
||||
<b>Multi-Episode Example: </b><span class="result"></span>
|
||||
</div>
|
||||
</div>
|
15
NzbDrone.Web/Views/Settings/MetadataPartial.cshtml
Normal file
15
NzbDrone.Web/Views/Settings/MetadataPartial.cshtml
Normal file
@ -0,0 +1,15 @@
|
||||
@using NzbDrone.Web.Helpers
|
||||
@model NzbDrone.Web.Models.EpisodeNamingModel
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<label class="labelClass">@Html.LabelFor(m => m.MetadataXbmcEnabled)
|
||||
<span class="small">@Html.DescriptionFor(m => m.MetadataXbmcEnabled)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.MetadataXbmcEnabled, new { @class = "inputClass checkClass" })
|
||||
|
||||
<label class="labelClass">@Html.LabelFor(m => m.MetadataUseBanners)
|
||||
<span class="small">@Html.DescriptionFor(m => m.MetadataUseBanners)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.MetadataUseBanners, new { @class = "inputClass checkClass" })
|
@ -20,51 +20,15 @@
|
||||
<div id="stylized">
|
||||
@using (Html.BeginForm("SaveNaming", "Settings", FormMethod.Post, new { id = "NamingForm", name = "NamingForm", @class = "settingsForm" }))
|
||||
{
|
||||
<div class="settingsContainer">
|
||||
@Html.ValidationSummary(true, "Unable to save your settings. Please correct the errors and try again.")
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeriesName)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeriesName)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.SeriesName, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.EpisodeName)
|
||||
<span class="small">@Html.DescriptionFor(m => m.EpisodeName)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.EpisodeName, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.ReplaceSpaces)
|
||||
<span class="small">@Html.DescriptionFor(m => m.ReplaceSpaces)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.ReplaceSpaces, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.AppendQuality)
|
||||
<span class="small">@Html.DescriptionFor(m => m.AppendQuality)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.AppendQuality, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolders)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeasonFolders)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.SeasonFolders, new { @class = "inputClass checkClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeasonFolderFormat)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeasonFolderFormat)</span>
|
||||
</label>
|
||||
@Html.TextBoxFor(m => m.SeasonFolderFormat, new { @class = "inputClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.SeparatorStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.SeparatorStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.SeparatorStyle, Model.SeparatorStyles, new { @class = "inputClass selectClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.NumberStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.NumberStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.NumberStyle, Model.NumberStyles, new { @class = "inputClass selectClass" })
|
||||
<label class="labelClass">@Html.LabelFor(m => m.MultiEpisodeStyle)
|
||||
<span class="small">@Html.DescriptionFor(m => m.MultiEpisodeStyle)</span>
|
||||
</label>
|
||||
@Html.DropDownListFor(m => m.MultiEpisodeStyle, Model.MultiEpisodeStyles, new { @class = "inputClass selectClass" })
|
||||
<div class="jquery-accordion">
|
||||
<h3><a href="#">Episode Naming</a></h3>
|
||||
<div id="episodeNamingContainer">
|
||||
@{Html.RenderPartial("EpisodeNamingPartial", Model);}
|
||||
</div>
|
||||
<div id="examples">
|
||||
<div id="singleEpisodeExample">
|
||||
<b>Single Episode Example: </b><span class="result"></span>
|
||||
</div>
|
||||
<div id="multiEpisodeExample">
|
||||
<b>Multi-Episode Example: </b><span class="result"></span>
|
||||
|
||||
<h3><a href="#">Metadata</a></h3>
|
||||
<div id="metadataContainer">
|
||||
@{Html.RenderPartial("MetaDataPartial", Model);}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user