Merge branch 'develop'

pull/4/head
Mark McDowall 11 years ago
commit ed1be19563

@ -1,9 +1,10 @@
module.exports = function (grunt) {
'use strict';
var outputRoot = '_output/';
var outputDir = outputRoot +'UI/';
var srcContent = 'UI/Content/';
var outputRoot = '_output/';
var outputDir = outputRoot +'UI/';
var srcRoot = 'src/UI/'
var srcContent = srcRoot + 'Content/';
var destContent = outputDir + 'Content/';
grunt.initConfig({
@ -11,36 +12,39 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'),
curl: {
'UI/JsLibraries/backbone.js' : 'http://documentcloud.github.io/backbone/backbone.js',
'UI/JsLibraries/backbone.marionette.js' : 'http://marionettejs.com/downloads/backbone.marionette.js',
'UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
'UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
'src/UI/JsLibraries/backbone.js' : 'http://documentcloud.github.io/backbone/backbone.js',
'src/UI/JsLibraries/backbone.marionette.js' : 'http://marionettejs.com/downloads/backbone.marionette.js',
'src/UI/JsLibraries/backbone.modelbinder.js' : 'http://raw.github.com/theironcook/Backbone.ModelBinder/master/Backbone.ModelBinder.js',
'src/UI/JsLibraries/backbone.shortcuts.js' : 'http://raw.github.com/bry4n/backbone-shortcuts/master/backbone.shortcuts.js',
'UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
'UI/JsLibraries/backbone.backgrid.paginator.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/paginator/backgrid-paginator.js',
'UI/JsLibraries/backbone.backgrid.filter.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/filter/backgrid-filter.js',
'src/UI/JsLibraries/backbone.pageable.js' : 'http://raw.github.com/wyuenho/backbone-pageable/master/lib/backbone-pageable.js',
'src/UI/JsLibraries/backbone.backgrid.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/backgrid.js',
'src/UI/JsLibraries/backbone.backgrid.paginator.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/paginator/backgrid-paginator.js',
'src/UI/JsLibraries/backbone.backgrid.filter.js' : 'http://raw.github.com/wyuenho/backgrid/master/lib/extensions/filter/backgrid-filter.js',
'UI/JsLibraries/backbone.validation.js' : 'https://raw.github.com/thedersen/backbone.validation/master/dist/backbone-validation.js',
'src/UI/JsLibraries/backbone.backgrid.selectall.js' : 'http://raw.github.com/wyuenho/backgrid-select-all/master/backgrid-select-all.js',
'src/UI/Content/Backgrid/selectall.css' : 'http://raw.github.com/wyuenho/backgrid-select-all/master/backgrid-select-all.css',
'UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
'UI/JsLibraries/handlebars.helpers.js' : 'http://raw.github.com/danharper/Handlebars-Helpers/master/helpers.js',
'src/UI/JsLibraries/backbone.validation.js' : 'https://raw.github.com/thedersen/backbone.validation/master/dist/backbone-validation.js',
'UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
'UI/JsLibraries/jquery.backstretch.js' : 'http://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.js',
'UI/JsLibraries/jquery.signalR.js' : 'http://raw.github.com/SignalR/SignalR/master/samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js',
'UI/JsLibraries/jquery.knob.js' : 'http://raw.github.com/aterrien/jQuery-Knob/master/js/jquery.knob.js',
'src/UI/JsLibraries/handlebars.runtime.js' : 'http://raw.github.com/wycats/handlebars.js/master/dist/handlebars.runtime.js',
'src/UI/JsLibraries/handlebars.helpers.js' : 'http://raw.github.com/danharper/Handlebars-Helpers/master/helpers.js',
'UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'UI/JsLibraries/filesize.js' : 'http://cdn.filesizejs.com/filesize.js',
'UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
'src/UI/JsLibraries/jquery.js' : 'http://code.jquery.com/jquery.js',
'src/UI/JsLibraries/jquery.backstretch.js' : 'http://raw.github.com/srobbin/jquery-backstretch/master/jquery.backstretch.js',
'src/UI/JsLibraries/jquery.signalR.js' : 'http://raw.github.com/SignalR/SignalR/master/samples/Microsoft.AspNet.SignalR.Hosting.AspNet.Samples/Scripts/jquery.signalR.js',
'src/UI/JsLibraries/jquery.knob.js' : 'http://raw.github.com/aterrien/jQuery-Knob/master/js/jquery.knob.js',
'src/UI/JsLibraries/require.js' : 'http://raw.github.com/jrburke/requirejs/master/require.js',
'src/UI/JsLibraries/filesize.js' : 'http://cdn.filesizejs.com/filesize.js',
'src/UI/JsLibraries/lodash.underscore.js' : 'http://raw.github.com/bestiejs/lodash/master/dist/lodash.underscore.js',
'UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
'UI/Content/Messenger/messenger.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger.css',
'UI/Content/Messenger/messenger.future.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger-theme-future.css',
'src/UI/JsLibraries/messenger.js' : 'http://raw.github.com/HubSpot/messenger/master/build/js/messenger.js',
'src/UI/Content/Messenger/messenger.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger.css',
'src/UI/Content/Messenger/messenger.future.css' : 'http://raw.github.com/HubSpot/messenger/master/build/css/messenger-theme-future.css',
'UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
'UI/Content/prefixer.less' : 'http://raw.github.com/JoelSutherland/LESS-Prefixer/master/prefixer.less'
'src/UI/Content/bootstrap.toggle-switch.css' : 'http://raw.github.com/ghinda/css-toggle-switch/gh-pages/toggle-switch.css',
'src/UI/Content/prefixer.less' : 'http://raw.github.com/JoelSutherland/LESS-Prefixer/master/prefixer.less'
},
clean: {
@ -63,19 +67,20 @@ module.exports = function (grunt) {
dest: destContent + 'bootstrap.css'
},
general : {
expand :true,
src : [
'UI/Content/theme.less',
'UI/Content/overrides.less',
'UI/Series/series.less',
'UI/AddSeries/addSeries.less',
'UI/Calendar/calendar.less',
'UI/Cells/cells.less',
'UI/Logs/logs.less',
'UI/Settings/settings.less',
'UI/Update/update.less'
cwd : srcRoot,
expand : true,
src :[
'Content/theme.less',
'Content/overrides.less',
'Series/series.less',
'AddSeries/addSeries.less',
'Calendar/calendar.less',
'Cells/cells.less',
'Settings/settings.less',
'System/Logs/logs.less',
'System/Update/update.less'
],
dest : outputRoot,
dest : outputDir,
ext: '.css'
}
},
@ -88,49 +93,65 @@ module.exports = function (grunt) {
amd : true,
processName: function (fileName) {
return fileName
.replace('UI/', '')
.replace(srcRoot, '')
.replace('.html', '')
.toLowerCase();
}
},
files : {
src : ['UI/**/*Template.html','UI/**/*Partial.html'],
src : [ srcRoot + '**/*Template.html', srcRoot + '**/*Partial.html'],
dest: outputDir + 'templates.js'
}
},
copy: {
index : {
src : 'UI/*ndex.html',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '*ndex.html',
dest : outputDir
},
scripts: {
src : 'UI/**/*.js',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/*.js',
dest : outputDir
},
styles : {
src : 'UI/**/*.css',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/*.css',
dest : outputDir
},
images : {
src : 'UI/**/*.png',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/*.png',
dest : outputDir
},
jpg : {
src : 'UI/**/*.jpg',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/*.jpg',
dest : outputDir
},
icon : {
src : 'UI/**/*.ico',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/*.ico',
dest : outputDir
},
fontAwesome : {
src : 'UI/**/FontAwesome/*.*',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/FontAwesome/*.*',
dest : outputDir
},
fonts : {
src : 'UI/**/fonts/*.*',
dest: outputRoot
cwd : srcRoot,
expand: true,
src : '**/fonts/*.*',
dest : outputDir
}
},
@ -143,7 +164,7 @@ module.exports = function (grunt) {
tasks: ['less:bootstrap','less:general']
},
generalLess: {
files: ['UI/**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**'],
files: [ srcRoot + '**/*.less', '!**/Bootstrap/**', '!**/FontAwesome/**'],
tasks: ['less:general']
},
handlebars : {
@ -151,35 +172,35 @@ module.exports = function (grunt) {
tasks: ['handlebars']
},
copyIndex : {
files: '<%= copy.index.src %>',
files: '<%= copy.index.cwd %><%= copy.index.src %>',
tasks: ['copy:index']
},
copyScripts: {
files: '<%= copy.scripts.src %>',
files: '<%= copy.scripts.cwd %><%= copy.scripts.src %>',
tasks: ['copy:scripts']
},
copyStyles : {
files: '<%= copy.styles.src %>',
files: '<%= copy.styles.cwd %><%= copy.styles.src %>',
tasks: ['copy:styles']
},
copyImages : {
files: '<%= copy.images.src %>',
files: '<%= copy.images.cwd %><%= copy.images.src %>',
tasks: ['copy:images']
},
copyJpg : {
files: '<%= copy.jpg.src %>',
files: '<%= copy.jpg.cwd %><%= copy.jpg.src %>',
tasks: ['copy:jpg']
},
copyIcon : {
files: '<%= copy.icon.src %>',
files: '<%= copy.icon.cwd %><%= copy.icon.src %>',
tasks: ['copy:icon']
},
copyFontAwesome : {
files: '<%= copy.fontAwesome.src %>',
files: '<%= copy.fontAwesome.cwd %><%= copy.fontAwesome.src %>',
tasks: ['copy:fontAwesome']
},
copyFonts : {
files: '<%= copy.fonts.src %>',
files: '<%= copy.fonts.cwd %><%= copy.fonts.src %>',
tasks: ['copy:fonts']
}
}

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using NzbDrone.Common;
using NzbDrone.Common.Reflection;
using NzbDrone.Core.Annotations;
namespace NzbDrone.Api.ClientSchema
{
public static class SchemaDeserializer
{
public static T DeserializeSchema<T>(T model, List<Field> fields)
{
var properties = model.GetType().GetSimpleProperties();
foreach (var propertyInfo in properties)
{
var fieldAttribute = propertyInfo.GetAttribute<FieldDefinitionAttribute>(false);
if (fieldAttribute != null)
{
var field = fields.Find(f => f.Name == propertyInfo.Name);
if (propertyInfo.PropertyType == typeof (Int32))
{
var intValue = Convert.ToInt32(field.Value);
propertyInfo.SetValue(model, intValue, null);
}
else if (propertyInfo.PropertyType == typeof(Nullable<Int32>))
{
var intValue = field.Value.ToString().ParseInt32();
propertyInfo.SetValue(model, intValue, null);
}
else
{
propertyInfo.SetValue(model, field.Value, null);
}
}
}
return model;
}
}
}

@ -1,44 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Api.Mapping;
using NzbDrone.Api.REST;
using NzbDrone.Core.Tv;
namespace NzbDrone.Api.Episodes
{
public class EpisodeModule : NzbDroneRestModule<EpisodeResource>
{
private readonly IEpisodeService _episodeService;
public EpisodeModule(IEpisodeService episodeService)
: base("/episodes")
{
_episodeService = episodeService;
GetResourceAll = GetEpisodes;
UpdateResource = SetMonitored;
GetResourceById = GetEpisode;
}
private List<EpisodeResource> GetEpisodes()
{
var seriesId = (int?)Request.Query.SeriesId;
if (seriesId == null)
{
throw new BadRequestException("seriesId is missing");
}
return ToListResource(() => _episodeService.GetEpisodeBySeries(seriesId.Value));
}
private void SetMonitored(EpisodeResource episodeResource)
{
_episodeService.SetEpisodeMonitored(episodeResource.Id, episodeResource.Monitored);
}
private EpisodeResource GetEpisode(int id)
{
return _episodeService.GetEpisode(id).InjectTo<EpisodeResource>();
}
}
}

@ -1,113 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.ClientSchema;
using NzbDrone.Api.REST;
using NzbDrone.Core.Indexers;
using Omu.ValueInjecter;
using FluentValidation;
using NzbDrone.Api.Mapping;
namespace NzbDrone.Api.Indexers
{
public class IndexerModule : NzbDroneRestModule<IndexerResource>
{
private readonly IIndexerService _indexerService;
public IndexerModule(IIndexerService indexerService)
{
_indexerService = indexerService;
GetResourceAll = GetAll;
GetResourceById = GetIndexer;
CreateResource = CreateIndexer;
UpdateResource = UpdateIndexer;
DeleteResource = DeleteIndexer;
SharedValidator.RuleFor(c => c.Name).NotEmpty();
SharedValidator.RuleFor(c => c.Implementation).NotEmpty();
PostValidator.RuleFor(c => c.Fields).NotEmpty();
}
private IndexerResource GetIndexer(int id)
{
return _indexerService.Get(id).InjectTo<IndexerResource>();
}
private List<IndexerResource> GetAll()
{
var indexers = _indexerService.All();
var result = new List<IndexerResource>(indexers.Count);
foreach (var indexer in indexers)
{
var indexerResource = new IndexerResource();
indexerResource.InjectFrom(indexer);
indexerResource.Fields = SchemaBuilder.GenerateSchema(indexer.Settings);
result.Add(indexerResource);
}
return result;
}
private int CreateIndexer(IndexerResource indexerResource)
{
var indexer = GetIndexer(indexerResource);
indexer = _indexerService.Create(indexer);
return indexer.Id;
}
private void UpdateIndexer(IndexerResource indexerResource)
{
var indexer = _indexerService.Get(indexerResource.Id);
indexer.InjectFrom(indexerResource);
indexer.Settings = SchemaDeserializer.DeserializeSchema(indexer.Settings, indexerResource.Fields);
ValidateIndexer(indexer);
_indexerService.Update(indexer);
}
private static void ValidateIndexer(Indexer indexer)
{
if (indexer.Enable)
{
var validationResult = indexer.Settings.Validate();
if (!validationResult.IsValid)
{
throw new ValidationException(validationResult.Errors);
}
}
}
private Indexer GetIndexer(IndexerResource indexerResource)
{
var indexer = _indexerService.Schema()
.SingleOrDefault(i =>
i.Implementation.Equals(indexerResource.Implementation,
StringComparison.InvariantCultureIgnoreCase));
if (indexer == null)
{
throw new BadRequestException("Invalid Indexer Implementation");
}
indexer.InjectFrom(indexerResource);
indexer.Settings = SchemaDeserializer.DeserializeSchema(indexer.Settings, indexerResource.Fields);
ValidateIndexer(indexer);
return indexer;
}
private void DeleteIndexer(int id)
{
_indexerService.Delete(id);
}
}
}

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,54 +0,0 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using NzbDrone.Api.REST;
using NzbDrone.Core.Update;
using NzbDrone.Api.Mapping;
namespace NzbDrone.Api.Update
{
public class UpdateModule : NzbDroneRestModule<UpdateResource>
{
private readonly ICheckUpdateService _checkUpdateService;
private readonly IRecentUpdateProvider _recentUpdateProvider;
public UpdateModule(ICheckUpdateService checkUpdateService,
IRecentUpdateProvider recentUpdateProvider)
{
_checkUpdateService = checkUpdateService;
_recentUpdateProvider = recentUpdateProvider;
GetResourceAll = GetRecentUpdates;
}
private UpdateResource GetAvailableUpdate()
{
var update = _checkUpdateService.AvailableUpdate();
var response = new UpdateResource();
if (update != null)
{
return update.InjectTo<UpdateResource>();
}
return response;
}
private List<UpdateResource> GetRecentUpdates()
{
return ToListResource(_recentUpdateProvider.GetRecentUpdatePackages);
}
}
public class UpdateResource : RestResource
{
[JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))]
public Version Version { get; set; }
public String Branch { get; set; }
public DateTime ReleaseDate { get; set; }
public String FileName { get; set; }
public String Url { get; set; }
public UpdateChanges Changes { get; set; }
}
}

@ -1,60 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
<IgnoredTests>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.EnviromentProviderTest.ApplicationPath_should_find_root_in_current_folder</TestName>
</NamedTestSelector>
<RegexTestSelector>
<RegularExpression>NzbDrone\.Common\.Test\.EventingTests\.ServiceNameFixture\..*</RegularExpression>
</RegexTestSelector>
<RegexTestSelector>
<RegularExpression>NzbDrone\.Common\.Test\.ServiceFactoryFixture\..*</RegularExpression>
</RegexTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.ToString_on_new_processInfo</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.Should_be_able_to_start_process</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.kill_all_should_kill_all_process_with_name</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.GetProcessById_should_return_null_for_invalid_process(9999)</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.GetProcessById_should_return_null_for_invalid_process(-1)</TestName>
</NamedTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.ProcessProviderTests.GetProcessById_should_return_null_for_invalid_process(0)</TestName>
</NamedTestSelector>
<RegexTestSelector>
<RegularExpression>NzbDrone\.Common\.Test\.ServiceProviderTests\..*</RegularExpression>
</RegexTestSelector>
<NamedTestSelector>
<TestName>NzbDrone.Common.Test.DiskProviderTests.DiskProviderFixture.folder_should_return_correct_value_for_last_write</TestName>
</NamedTestSelector>
<RegexTestSelector>
<RegularExpression>NzbDrone\.Common\.Test\.DiskProviderTests\.DiskProviderFixture\..*</RegularExpression>
</RegexTestSelector>
</IgnoredTests>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Config>
<Port>8989</Port>
<LaunchBrowser>true</LaunchBrowser>
</Config>

@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
namespace NzbDrone.Core.Indexers
{
public abstract class IndexerBase : IIndexer
{
public abstract string Name { get; }
public abstract IndexerKind Kind { get; }
public virtual bool EnableByDefault { get { return true; } }
public IndexerDefinition InstanceDefinition { get; set; }
public virtual IEnumerable<IndexerDefinition> DefaultDefinitions
{
get
{
yield return new IndexerDefinition
{
Name = Name,
Enable = EnableByDefault,
Implementation = GetType().Name,
Settings = String.Empty
};
}
}
public virtual IParseFeed Parser { get; private set; }
public abstract IEnumerable<string> RecentFeed { get; }
public abstract IEnumerable<string> GetEpisodeSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int episodeNumber);
public abstract IEnumerable<string> GetDailyEpisodeSearchUrls(string seriesTitle, int tvRageId, DateTime date);
public abstract IEnumerable<string> GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int offset);
}
public enum IndexerKind
{
Usenet,
Torrent
}
}

@ -1,13 +0,0 @@
using System;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Indexers
{
public class IndexerDefinition : ModelBase
{
public Boolean Enable { get; set; }
public String Name { get; set; }
public String Settings { get; set; }
public String Implementation { get; set; }
}
}

@ -1,33 +0,0 @@
using System;
using System.Linq;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Indexers
{
public interface IIndexerRepository : IBasicRepository<IndexerDefinition>
{
IndexerDefinition Get(string name);
IndexerDefinition Find(string name);
}
public class IndexerRepository : BasicRepository<IndexerDefinition>, IIndexerRepository
{
public IndexerRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public IndexerDefinition Get(string name)
{
return Query.Single(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
public IndexerDefinition Find(string name)
{
return Query.SingleOrDefault(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
}
}

@ -1,201 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Lifecycle;
using NzbDrone.Core.Messaging.Events;
using Omu.ValueInjecter;
namespace NzbDrone.Core.Indexers
{
public class Indexer
{
public int Id { get; set; }
public string Name { get; set; }
public bool Enable { get; set; }
public IIndexerSetting Settings { get; set; }
public IIndexer Instance { get; set; }
public string Implementation { get; set; }
}
public interface IIndexerService
{
List<Indexer> All();
List<IIndexer> GetAvailableIndexers();
Indexer Get(int id);
Indexer Get(string name);
List<Indexer> Schema();
Indexer Create(Indexer indexer);
Indexer Update(Indexer indexer);
void Delete(int id);
}
public class IndexerService : IIndexerService, IHandle<ApplicationStartedEvent>
{
private readonly IIndexerRepository _indexerRepository;
private readonly IConfigFileProvider _configFileProvider;
private readonly INewznabTestService _newznabTestService;
private readonly Logger _logger;
private readonly List<IIndexer> _indexers;
public IndexerService(IIndexerRepository indexerRepository,
IEnumerable<IIndexer> indexers,
IConfigFileProvider configFileProvider,
INewznabTestService newznabTestService,
Logger logger)
{
_indexerRepository = indexerRepository;
_configFileProvider = configFileProvider;
_newznabTestService = newznabTestService;
_logger = logger;
if (!configFileProvider.Torrent)
{
_indexers = indexers.Where(c => c.Kind != IndexerKind.Torrent).ToList();
}
else
{
_indexers = indexers.ToList();
}
}
public List<Indexer> All()
{
return _indexerRepository.All().Select(ToIndexer).ToList();
}
public List<IIndexer> GetAvailableIndexers()
{
return All().Where(c => c.Enable && c.Settings.Validate().IsValid).Select(c => c.Instance).ToList();
}
public Indexer Get(int id)
{
return ToIndexer(_indexerRepository.Get(id));
}
public Indexer Get(string name)
{
return ToIndexer(_indexerRepository.Get(name));
}
public List<Indexer> Schema()
{
var indexers = new List<Indexer>();
var newznab = new Indexer();
newznab.Instance = new Newznab.Newznab();
newznab.Id = 1;
newznab.Name = "Newznab";
newznab.Settings = new NewznabSettings();
newznab.Implementation = "Newznab";
indexers.Add(newznab);
return indexers;
}
public Indexer Create(Indexer indexer)
{
var definition = new IndexerDefinition
{
Name = indexer.Name,
Enable = indexer.Enable,
Implementation = indexer.Implementation,
Settings = indexer.Settings.ToJson()
};
var instance = ToIndexer(definition).Instance;
_newznabTestService.Test(instance);
definition = _indexerRepository.Insert(definition);
indexer.Id = definition.Id;
return indexer;
}
public Indexer Update(Indexer indexer)
{
var definition = _indexerRepository.Get(indexer.Id);
definition.InjectFrom(indexer);
definition.Settings = indexer.Settings.ToJson();
_indexerRepository.Update(definition);
return indexer;
}
public void Delete(int id)
{
_indexerRepository.Delete(id);
}
private Indexer ToIndexer(IndexerDefinition definition)
{
var indexer = new Indexer();
indexer.Id = definition.Id;
indexer.Enable = definition.Enable;
indexer.Instance = GetInstance(definition);
indexer.Name = definition.Name;
indexer.Implementation = definition.Implementation;
if (indexer.Instance.GetType().GetMethod("ImportSettingsFromJson") != null)
{
indexer.Settings = ((dynamic)indexer.Instance).ImportSettingsFromJson(definition.Settings);
}
else
{
indexer.Settings = NullSetting.Instance;
}
return indexer;
}
private IIndexer GetInstance(IndexerDefinition indexerDefinition)
{
var type = GetImplementation(indexerDefinition);
var instance = (IIndexer)Activator.CreateInstance(type);
instance.InstanceDefinition = indexerDefinition;
return instance;
}
private Type GetImplementation(IndexerDefinition indexerDefinition)
{
return _indexers.Select(c => c.GetType()).SingleOrDefault(c => c.Name.Equals(indexerDefinition.Implementation, StringComparison.InvariantCultureIgnoreCase));
}
public void Handle(ApplicationStartedEvent message)
{
_logger.Debug("Initializing indexers. Count {0}", _indexers.Count);
RemoveMissingImplementations();
var definitions = _indexers.SelectMany(indexer => indexer.DefaultDefinitions);
var currentIndexer = All();
var newIndexers = definitions.Where(def => currentIndexer.All(c => c.Implementation != def.Implementation)).ToList();
if (newIndexers.Any())
{
_indexerRepository.InsertMany(newIndexers);
}
}
private void RemoveMissingImplementations()
{
var storedIndexers = _indexerRepository.All();
foreach (var indexerDefinition in storedIndexers.Where(i => GetImplementation(i) == null))
{
_logger.Debug("Removing Indexer {0} ", indexerDefinition.Name);
_indexerRepository.Delete(indexerDefinition);
}
}
}
}

@ -1,31 +0,0 @@
using NzbDrone.Common.Serializer;
namespace NzbDrone.Core.Indexers
{
public interface IProviderIndexerSetting
{
TSetting Get<TSetting>(IIndexer indexer) where TSetting : IIndexerSetting, new();
}
public class IndexerSettingProvider : IProviderIndexerSetting
{
private readonly IIndexerRepository _indexerRepository;
public IndexerSettingProvider(IIndexerRepository indexerRepository)
{
_indexerRepository = indexerRepository;
}
public TSetting Get<TSetting>(IIndexer indexer) where TSetting : IIndexerSetting, new()
{
var indexerDef = _indexerRepository.Find(indexer.Name);
if (indexerDef == null || string.IsNullOrWhiteSpace(indexerDef.Settings))
{
return new TSetting();
}
return Json.Deserialize<TSetting>(indexerDef.Settings);
}
}
}

@ -1,21 +0,0 @@
using NzbDrone.Common.Serializer;
namespace NzbDrone.Core.Indexers
{
public abstract class IndexerWithSetting<TSetting> : IndexerBase where TSetting : class, IIndexerSetting, new()
{
public TSetting Settings { get; set; }
public override bool EnableByDefault
{
get { return false; }
}
public TSetting ImportSettingsFromJson(string json)
{
Settings = Json.Deserialize<TSetting>(json) ?? new TSetting();
return Settings;
}
}
}

@ -1,7 +0,0 @@
namespace NzbDrone.Core.Notifications
{
public interface INotifcationSettings
{
bool IsValid { get; }
}
}

@ -1,23 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
<HiddenWarnings>PostBuildEventDisabled</HiddenWarnings>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
</ProjectConfiguration>

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configurations lcid_type="UserExe" show_language_selector="False" language_selector_title="" language_selector_ok="OK" language_selector_cancel="Cancel" configuration_no_match_message="" ui_level="basic" fileversion="" productversion="" log_enabled="True" log_file="#TEMPPATH\dotNetInstallerLog.txt">
<schema version="2.2.824.0" generator="dotNetInstaller InstallerEditor" />
<configuration dialog_caption="SyntikX Installer" dialog_message="Following components need to be installed" dialog_message_uninstall="" dialog_bitmap="#APPPATH\banner.bmp" skip_caption="Skip" install_caption="Install" uninstall_caption="Uninstall" cancel_caption="Close" status_installed=" (Already Installed)" status_notinstalled="" failed_exec_command_continue="Failed to install %s." installation_completed="SyntikX installed successfully!" uninstallation_completed="SyntikX uninstalled successfully!" installation_none="SyntikX is not compatible with your machine. Please contact support for more information." uninstallation_none="SyntikX is not installed!" installing_component_wait="Installing %s. Wait, this operation could take some time ..." uninstalling_component_wait="Uninstalling %s. Wait, this operation could take some time ..." reboot_required="To continue the installation you must restart your computer. Restart now?" must_reboot_required="False" dialog_otherinfo_caption="" dialog_otherinfo_link="" complete_command="" complete_command_silent="" complete_command_basic="" wait_for_complete_command="True" prompt_for_optional_components="False" auto_close_if_installed="False" auto_close_on_error="False" reload_on_error="True" dialog_show_installed="True" dialog_show_uninstalled="False" dialog_show_required="True" cab_dialog_message="%s" cab_cancelled_message="" cab_dialog_caption="" cab_path="#TEMPPATH\#GUID" cab_path_autodelete="True" dialog_default_button="install" dialog_position="" dialog_components_list_position="" dialog_message_position="" dialog_bitmap_position="" dialog_otherinfo_link_position="" dialog_osinfo_position="" dialog_install_button_position="" dialog_cancel_button_position="" dialog_skip_button_position="" auto_start="True" auto_continue_on_reboot="True" reboot_cmd="" show_progress_dialog="False" show_cab_dialog="True" disable_wow64_fs_redirection="False" administrator_required="False" administrator_required_message="SyntikX installation requires administration rights." type="install" lcid_filter="" language_id="" language="" os_filter="" os_filter_min="" os_filter_max="" processor_architecture_filter="" supports_install="True" supports_uninstall="False">
<component executable="#TEMPPATH\syntik_bootstrap\WindowsXP-KB936929-SP3-x86-ENU.exe" executable_silent="" executable_basic="" install_directory="" responsefile_source="" responsefile_target="" responsefile_format="none" uninstall_executable="" uninstall_executable_silent="" uninstall_executable_basic="" uninstall_responsefile_source="" uninstall_responsefile_target="" returncodes_success="" returncodes_reboot="" exeparameters="" exeparameters_basic="" exeparameters_silent="" uninstall_exeparameters="" uninstall_exeparameters_basic="" uninstall_exeparameters_silent="" disable_wow64_fs_redirection="False" id="XPSP3" display_name="Windows XP Service Pack 3" uninstall_display_name="" os_filter="" os_filter_min="winXPsp1" os_filter_max="winXPsp2" os_filter_lcid="" type="exe" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="False" selected_install="True" selected_uninstall="True" note="Windows XP Service Pack 3" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
<downloaddialog dialog_caption="Download Windows XP Service Pack 3" dialog_message="SyntikX requires Windows XP Service Pack 3 or latter. Press start to automatically download and install this update." dialog_message_downloading="Downloading ..." dialog_message_copying="Copying ..." dialog_message_connecting="Connecting ..." dialog_message_sendingrequest="Sending request ..." autostartdownload="False" buttonstart_caption="Start" buttoncancel_caption="Cancel">
<download componentname="Windows XP Service Pack 3" sourceurl="http://download.microsoft.com/download/d/3/0/d30e32d8-418a-469d-b600-f32ce3edf42d/WindowsXP-KB936929-SP3-x86-ENU.exe" sourcepath="" destinationpath="#TEMPPATH\syntik_bootstrap\" destinationfilename="" alwaysdownload="False" clear_cache="False" />
</downloaddialog>
</component>
<component command="#TEMPPATH\syntik_bootstrap\dotNetFx40_Full_setup.exe /passive" command_silent="" command_basic="" uninstall_command="" uninstall_command_silent="" uninstall_command_basic="" returncodes_success="" returncodes_reboot="3010" disable_wow64_fs_redirection="False" id="Microsoft .NET Framework 4.0 - Full" display_name="Microsoft .NET Framework 4.0 " uninstall_display_name="" os_filter="" os_filter_min="winXPsp3" os_filter_max="" os_filter_lcid="" type="cmd" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="False" selected_install="True" selected_uninstall="False" note="English - WebSetup - .NET Framework 4.0 - Full for all operating system since Windows XP SP3 (Install check)" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="False" show_progress_dialog="True" show_cab_dialog="True">
<installedcheck path="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" fieldname="Install" fieldvalue="1" defaultvalue="False" fieldtype="REG_DWORD" comparison="match" rootkey="HKEY_LOCAL_MACHINE" wowoption="NONE" type="check_registry_value" description="Installed Check" />
<downloaddialog dialog_caption="Microsoft .NET Framework 4.0" dialog_message="Press 'Start' to download and install Microsoft .NET Framework 4.0 - Full" dialog_message_downloading="Download in progress. Please wait..." dialog_message_copying="Files are downloaded. Please wait ..." dialog_message_connecting="Connecting ..." dialog_message_sendingrequest="Sending request ..." autostartdownload="True" buttonstart_caption="Start" buttoncancel_caption="Cancel">
<download componentname="Microsoft .NET Framework 4.0" sourceurl="http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe" sourcepath="" destinationpath="#TEMPPATH\syntik_bootstrap\" destinationfilename="" alwaysdownload="True" clear_cache="True" />
</downloaddialog>
</component>
<component package="#TEMPPATH\syntik_update\syntikx.msi" cmdparameters="" cmdparameters_silent="" cmdparameters_basic="" uninstall_package="" uninstall_cmdparameters="/qb-" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/qb-" disable_wow64_fs_redirection="False" id="SyntikX" display_name="SyntikX" uninstall_display_name="" os_filter="" os_filter_min="winXPsp3" os_filter_max="" os_filter_lcid="" type="msi" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="False" default_continue_on_error="False" required_install="True" required_uninstall="True" selected_install="True" selected_uninstall="True" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="True" show_progress_dialog="True" show_cab_dialog="True">
<downloaddialog dialog_caption="Downloading latest version of SyntikX" dialog_message="Press 'Start' to install latest version of SyntikX" dialog_message_downloading="Downloading ..." dialog_message_copying="Copying ..." dialog_message_connecting="Connecting ..." dialog_message_sendingrequest="Sending request ..." autostartdownload="True" buttonstart_caption="Start" buttoncancel_caption="Cancel">
<download componentname="Download Setup" sourceurl="http://localhost:59330/v1/update" sourcepath="" destinationpath="#TEMPPATH\syntik_update\" destinationfilename="syntikx.msi" alwaysdownload="True" clear_cache="True" />
</downloaddialog>
</component>
</configuration>
</configurations>

Binary file not shown.

@ -1,8 +0,0 @@
rd _raw /s /q
rd _setup /s /q
xcopy ..\SyntikX.Client\bin\release\*.* _raw\ /S /V /I /F /R
"C:\Program Files (x86)\WiX Toolset v3.6\bin\candle.exe" -nologo "syntik.wix.build.wxs" -out "_setup\SyntikX.Wix.wixobj" -ext WixNetFxExtension -ext WixUIExtension
"C:\Program Files (x86)\WiX Toolset v3.6\bin\light.exe" -nologo "_setup\SyntikX.Wix.wixobj" -out "_setup\SyntikX.msi" -ext WixNetFxExtension -ext WixUIExtension
pause

@ -1,10 +0,0 @@
rd _raw /s /q
rd _setup /s /q
xcopy ..\SyntikX.Client\bin\debug\*.* _raw\ /S /V /I /F /R
SET BUILD_NUMBER=1.9.9.9
"C:\Program Files (x86)\WiX Toolset v3.6\bin\candle.exe" -nologo "syntik.wix.build.wxs" -out "_setup\SyntikX.Wix.wixobj" -ext WixNetFxExtension -ext WixUIExtension
"C:\Program Files (x86)\WiX Toolset v3.6\bin\light.exe" -nologo "_setup\SyntikX.Wix.wixobj" -out "_setup\SyntikX.Wix.msi" -ext WixNetFxExtension -ext WixUIExtension
pause

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="NzbDrone" Language="1033" Version="$(env.BUILD_NUMBER)" Manufacturer="NzbDrone Team" UpgradeCode="56833D74-A480-4CA2-B562-5A018B3A0F99">
<Package Description="NzbDrone"
Comments="NzbDrone"
InstallerVersion="200"
Compressed="yes"
InstallPrivileges="limited"
InstallScope="perUser"
Platform="x86"
Manufacturer="NzbDrone Team"
/>
<Media Id="1" Cabinet="NzbDrone.cab" EmbedCab="yes" CompressionLevel="high"/>
<Property Id="ARPPRODUCTICON" Value="ND_ICON" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LocalAppDataFolder" Name="AppDataFolder">
<Directory Name="NzbDrone" Id="SX_ROOT">
<Component Id="SX_APP_COMP" DiskId="1" Guid="9c3ac309-cde4-4338-be75-a914cbce2601">
<File Id="SX_EXE_FILE" Name="NzbDrone.Client.exe" Source="_raw\NzbDrone.Client.exe" />
<File Id="AUTOFAC.CONFIGURATION.DLL" Name="Autofac.Configuration.dll" Source="_raw\Autofac.Configuration.dll" />
<File Id="AUTOFAC.DLL" Name="Autofac.dll" Source="_raw\Autofac.dll" />
<File Id="BCRYPT.NET.DLL" Name="BCrypt.Net.dll" Source="_raw\BCrypt.Net.dll" />
<File Id="CALIBURN.MICRO.DLL" Name="Caliburn.Micro.dll" Source="_raw\Caliburn.Micro.dll" />
<File Id="ICSHARPCODE.SHARPZIPLIB.DLL" Name="ICSharpCode.SharpZipLib.dll" Source="_raw\ICSharpCode.SharpZipLib.dll" />
<File Id="MAHAPPS.METRO.DLL" Name="MahApps.Metro.dll" Source="_raw\MahApps.Metro.dll" />
<File Id="NEWTONSOFT.JSON.DLL" Name="Newtonsoft.Json.dll" Source="_raw\Newtonsoft.Json.dll" />
<File Id="NLOG.DLL" Name="NLog.dll" Source="_raw\NLog.dll" />
<File Id="RESTSHARP.DLL" Name="RestSharp.dll" Source="_raw\RestSharp.dll" />
<File Id="EXCEPTRON.CLIENT.DLL" Name="exceptron.client.dll" Source="_raw\exceptron.client.dll" />
<File Id="EXCEPTRON.NLOG.DLL" Name="exceptron.nlog.dll" Source="_raw\exceptron.nlog.dll" />
<File Id="NzbDrone.CLIENT.CORE.DLL" Name="NzbDrone.Client.Core.dll" Source="_raw\NzbDrone.Client.Core.dll" />
<File Id="NzbDrone.CLIENT.CORE.PDB" Name="NzbDrone.Client.Core.pdb" Source="_raw\NzbDrone.Client.Core.pdb" />
<File Id="NzbDrone.CLIENT.EXE.CONFIG" Name="NzbDrone.Client.exe.config" Source="_raw\NzbDrone.Client.exe.config" />
<File Id="NzbDrone.CLIENT.PDB" Name="NzbDrone.Client.pdb" Source="_raw\NzbDrone.Client.pdb" />
<File Id="NzbDrone.SHARED.DLL" Name="NzbDrone.Shared.dll" Source="_raw\NzbDrone.Shared.dll" />
<File Id="NzbDrone.SHARED.PDB" Name="NzbDrone.Shared.pdb" Source="_raw\NzbDrone.Shared.pdb" />
<File Id="SYSTEM.WINDOWS.INTERACTIVITY.DLL" Name="System.Windows.Interactivity.dll" Source="_raw\System.Windows.Interactivity.dll" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\NzbDrone" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RemoveFolder Id="SX_ROOT" On="uninstall" />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder">
<Component Id="SX_DESKTOP_SHORTCUT_COMP" Guid="1f395635-7a9d-454d-aab4-95a5a4e70be4">
<Shortcut Id="SX_DESKTOP_SHORTCUT" Name="NzbDrone" Description="NzbDrone Backup Client" Target="[SX_ROOT]NzbDrone.Client.exe" WorkingDirectory="SX_ROOT" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\NzbDrone" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="SX_START_DIR" Name="NzbDrone">
<Component Id="SX_START_SHORTCUT_COMP" Guid="8b3d54c6-712b-4bc2-b1e9-7cf40bcc1344">
<Shortcut Id="SX_START_SHORTCUT" Name="NzbDrone" Description="NzbDrone Backup Client" Target="[SX_ROOT]NzbDrone.Client.exe" WorkingDirectory="SX_ROOT" />
<RemoveFolder Id="SX_START_DIR" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\NzbDrone" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
<Directory Id="StartupFolder" Name="Startup">
<Component Id="SX_STARTUP_SHORTCUT_COMP" Guid="0fdfe510-621e-4925-a0d4-395617fb7cbc">
<Shortcut Id="SX_STARTUP_SHORTCUT" Name="NzbDrone" Description="NzbDrone Backup Client" Target="[SX_ROOT]NzbDrone.Client.exe" Arguments="/startup" WorkingDirectory="SX_ROOT" />
<RegistryValue Root="HKCU" Key="Software\Microsoft\NzbDrone" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<!--<UIRef Id="WixUI_Minimal" />-->
<UI />
<MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" MigrateFeatures="yes" Schedule="afterInstallInitialize" DowngradeErrorMessage="Newer version of NzbDrone is already installed." />
<Feature Id="DefaultFeature" Title="Main Feature" Level="1">
<ComponentRef Id="SX_APP_COMP" />
<ComponentRef Id="SX_START_SHORTCUT_COMP" />
<ComponentRef Id="SX_STARTUP_SHORTCUT_COMP" />
<ComponentRef Id="SX_DESKTOP_SHORTCUT_COMP" />
</Feature>
<PropertyRef Id="NETFRAMEWORK40FULL" />
<Condition Message="This application requires .NET Framework 4.0 or later. Please install the .NET Framework then run this installer again.">NETFRAMEWORK40FULL</Condition>
<Icon Id="SX_ICON" SourceFile="_raw\NzbDrone.Client.exe" />
<InstallExecuteSequence>
<InstallInitialize/>
<Custom Action="SX_START_ACTION" After="InstallFiles" />
<InstallFinalize/>
</InstallExecuteSequence>
<CustomAction Id="SX_START_ACTION" FileKey="SX_EXE_FILE" ExeCommand="" Execute="deferred" Impersonate="no" Return="asyncNoWait" />
</Product>
</Wix>

@ -1,13 +0,0 @@
<SolutionConfiguration>
<FileVersion>1</FileVersion>
<AutoEnableOnStartup>True</AutoEnableOnStartup>
<AllowParallelTestExecution>true</AllowParallelTestExecution>
<AllowTestsToRunInParallelWithThemselves>true</AllowTestsToRunInParallelWithThemselves>
<FrameworkUtilisationTypeForNUnit>UseDynamicAnalysis</FrameworkUtilisationTypeForNUnit>
<FrameworkUtilisationTypeForGallio>Disabled</FrameworkUtilisationTypeForGallio>
<FrameworkUtilisationTypeForMSpec>Disabled</FrameworkUtilisationTypeForMSpec>
<FrameworkUtilisationTypeForMSTest>Disabled</FrameworkUtilisationTypeForMSTest>
<EngineModes>Run all tests automatically:BFRydWU=;Run all tests manually:BUZhbHNl;Run impacted tests automatically, others manually (experimental!):CklzSW1wYWN0ZWQ=;Run pinned tests automatically, others manually:CElzUGlubmVk;Fast:DlN0cnVjdHVyYWxOb2RlBAAAABNEb2VzTm90SGF2ZUNhdGVnb3J5D0ludGVncmF0aW9uVGVzdBNEb2VzTm90SGF2ZUNhdGVnb3J5BkRiVGVzdApJc0ltcGFjdGVkE0RvZXNOb3RIYXZlQ2F0ZWdvcnkORGlza0FjY2Vzc1Rlc3QAAAAAAAAAAAAAAAA=</EngineModes>
<MetricsExclusionList>
</MetricsExclusionList>
</SolutionConfiguration>

@ -1,23 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
<HiddenWarnings>PostBuildEventDisabled</HiddenWarnings>
</ProjectConfiguration>

@ -1,23 +0,0 @@
<ProjectConfiguration>
<CopyReferencedAssembliesToWorkspace>false</CopyReferencedAssembliesToWorkspace>
<ConsiderInconclusiveTestsAsPassing>true</ConsiderInconclusiveTestsAsPassing>
<PreloadReferencedAssemblies>false</PreloadReferencedAssemblies>
<AllowDynamicCodeContractChecking>false</AllowDynamicCodeContractChecking>
<AllowStaticCodeContractChecking>false</AllowStaticCodeContractChecking>
<IgnoreThisComponentCompletely>false</IgnoreThisComponentCompletely>
<RunPreBuildEvents>false</RunPreBuildEvents>
<RunPostBuildEvents>false</RunPostBuildEvents>
<PreviouslyBuiltSuccessfully>true</PreviouslyBuiltSuccessfully>
<InstrumentAssembly>true</InstrumentAssembly>
<PreventSigningOfAssembly>false</PreventSigningOfAssembly>
<AnalyseExecutionTimes>true</AnalyseExecutionTimes>
<IncludeStaticReferencesInWorkspace>true</IncludeStaticReferencesInWorkspace>
<DefaultTestTimeout>5000</DefaultTestTimeout>
<UseBuildConfiguration>Debug</UseBuildConfiguration>
<UseBuildPlatform>x86</UseBuildPlatform>
<ProxyProcessPath></ProxyProcessPath>
<UseCPUArchitecture>x86</UseCPUArchitecture>
<MSTestThreadApartmentState>STA</MSTestThreadApartmentState>
<BuildProcessArchitecture>x86</BuildProcessArchitecture>
<HiddenWarnings>PostBuildEventDisabled</HiddenWarnings>
</ProjectConfiguration>

@ -1,35 +0,0 @@
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: url('/Content/fonts/OpenSans-Light.eot');
src: local('Open Sans Light'),
local('OpenSans-Light'),
url('/Content/fonts/OpenSans-Light.eot?#iefix') format('embedded-opentype'),
url('/Content/fonts/OpenSans-Light.woff') format('woff'),
url('/Content/fonts/OpenSans-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: url('/Content/fonts/OpenSans-Regular.eot');
src: local('Open Sans'),
local('OpenSans'),
url('/Content/fonts/OpenSans-Regular.eot?#iefix') format('embedded-opentype'),
url('/Content/fonts/OpenSans-Regular.woff') format('woff'),
url('/Content/fonts/OpenSans-Regular.ttf') format('truetype')
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: url('/Content/fonts/OpenSans-SemiBold.eot');
src: local('Open Sans SemiBold'),
local('OpenSans-SemiBold'),
url('/Content/fonts/OpenSans-SemiBold.eot?#iefix') format('embedded-opentype'),
url('/Content/fonts/OpenSans-SemiBold.woff') format('woff'),
url('/Content/fonts/OpenSans-SemiBold.ttf') format('truetype')
}

@ -1,18 +0,0 @@
'use strict';
define(
[
'handlebars'
], function (Handlebars) {
Handlebars.registerHelper('currentVersion', function (version) {
var currentVersion = window.NzbDrone.ServerStatus.version;
if (currentVersion === version)
{
return new Handlebars.SafeString('<i class="icon-ok" title="Installed"></i>');
}
return '';
});
});

@ -1 +0,0 @@
<img src="favicon.ico" alt="{{indexer}}"/>

@ -1,53 +0,0 @@
@import "../Content/FontAwesome/font-awesome";
@import "../Shared/Styles/clickable";
#logs-screen {
.log-time-cell{
width: 80px;
}
.log-level-cell{
width: 12px;
font-size: 14px;
}
td{
font-size: 13px;
}
.icon-info:before {
.icon(@info-sign);
color : dodgerblue;
}
.icon-debug:before {
.icon(@info-sign);
color : gray;
}
.icon-trace:before {
.icon(@info-sign);
color : lightgrey;
}
.icon-warn:before {
.icon(@exclamation-sign);
color : orange;
}
.icon-error:before {
.icon(@bug);
color : red;
}
.icon-fatal:before {
.icon(@remove-sign);
color : purple;
}
}
.log-file-row {
.clickable;
}

@ -1,8 +0,0 @@
'use strict';
define(
[
'backbone'
], function (Backbone) {
return Backbone.Model.extend({
});
});

@ -1,101 +0,0 @@
'use strict';
define(
[
'marionette',
'backgrid',
'Missing/Collection',
'Cells/SeriesTitleCell',
'Cells/EpisodeNumberCell',
'Cells/EpisodeTitleCell',
'Cells/RelativeDateCell',
'Shared/Grid/Pager',
'Shared/Toolbar/ToolbarLayout',
'Shared/LoadingView'
], function (Marionette, Backgrid, MissingCollection, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, RelativeDateCell, GridPager, ToolbarLayout, LoadingView) {
return Marionette.Layout.extend({
template: 'Missing/MissingLayoutTemplate',
regions: {
missing: '#x-missing',
toolbar: '#x-toolbar',
pager : '#x-pager'
},
columns:
[
{
name : 'series',
label : 'Series Title',
sortable: false,
cell : SeriesTitleCell
},
{
name : 'this',
label : 'Episode',
sortable: false,
cell : EpisodeNumberCell
},
{
name : 'this',
label : 'Episode Title',
sortable: false,
cell : EpisodeTitleCell
},
{
name : 'airDateUtc',
label: 'Air Date',
cell : RelativeDateCell
}
],
leftSideButtons: {
type : 'default',
storeState: false,
items :
[
{
title : 'Season Pass',
icon : 'icon-bookmark',
route : 'seasonpass'
}
]
},
_showTable: function () {
this.missing.show(new Backgrid.Grid({
columns : this.columns,
collection: this.missingCollection,
className : 'table table-hover'
}));
this.pager.show(new GridPager({
columns : this.columns,
collection: this.missingCollection
}));
},
initialize: function () {
this.missingCollection = new MissingCollection();
this.listenTo(this.missingCollection, 'sync', this._showTable);
},
onShow: function () {
this.missing.show(new LoadingView());
this.missingCollection.fetch();
this._showToolbar();
},
_showToolbar: function () {
this.toolbar.show(new ToolbarLayout({
left :
[
this.leftSideButtons
],
context: this
}));
}
});
});

@ -1,17 +0,0 @@
'use strict';
define([
'Settings/SettingsModelBase'], function (ModelBase) {
return ModelBase.extend({
baseInitialize: ModelBase.prototype.initialize,
initialize: function () {
var name = this.get('name');
this.successMessage = 'Saved indexer: ' + name;
this.errorMessage = 'Couldn\'t save indexer: ' + name;
this.baseInitialize.call(this);
}
});
});

@ -1,63 +0,0 @@
'use strict';
define(
[
'app',
'marionette',
'System/StatusModel',
'System/About/View',
'Logs/Layout',
'Shared/Toolbar/ToolbarLayout'
], function (App,
Marionette,
StatusModel,
AboutView,
LogsLayout,
ToolbarLayout) {
return Marionette.Layout.extend({
template: 'System/LayoutTemplate',
regions: {
toolbar : '#toolbar',
about : '#about',
loading : '#loading'
},
leftSideButtons: {
type : 'default',
storeState: false,
items :
[
{
title: 'Logs',
icon : 'icon-book',
route: 'logs'
},
{
title : 'Updates',
icon : 'icon-upload-alt',
route : 'update'
}
]
},
initialize: function () {
this.statusModel = StatusModel;
},
onRender: function () {
this._showToolbar();
this.about.show(new AboutView({ model: this.statusModel }));
},
_showToolbar: function () {
this.toolbar.show(new ToolbarLayout({
left :
[
this.leftSideButtons
],
context: this
}));
}
});
});

@ -1,17 +0,0 @@
<div class="row">
<div class="span12">
<div id="toolbar"></div>
</div>
</div>
<div class="row">
<div class="span12">
<div id="about"></div>
</div>
</div>
<div class="row">
<div class="span12">
<div id="loading"></div>
</div>
</div>

@ -1,11 +0,0 @@
'use strict';
define(
[
'app',
'marionette'
], function (App, Marionette) {
return Marionette.ItemView.extend({
template: 'Update/UpdateItemViewTemplate'
});
});

@ -1,58 +0,0 @@
'use strict';
define(
[
'marionette',
'backgrid',
'Update/UpdateCollection',
'Update/UpdateCollectionView',
'Shared/Toolbar/ToolbarLayout',
'Shared/LoadingView'
], function (Marionette, Backgrid, UpdateCollection, UpdateCollectionView, ToolbarLayout, LoadingView) {
return Marionette.Layout.extend({
template: 'Update/UpdateLayoutTemplate',
regions: {
updates: '#x-updates',
toolbar: '#x-toolbar'
},
leftSideButtons: {
type : 'default',
storeState: false,
items :
[
{
title : 'Check for Update',
icon : 'icon-nd-update',
command: 'applicationUpdate'
}
]
},
initialize: function () {
this.updateCollection = new UpdateCollection();
},
onRender: function () {
this.updates.show(new LoadingView());
this._showToolbar();
var self = this;
var promise = this.updateCollection.fetch();
promise.done(function (){
self.updates.show(new UpdateCollectionView({ collection: self.updateCollection }));
});
},
_showToolbar: function () {
this.toolbar.show(new ToolbarLayout({
left :
[
this.leftSideButtons
],
context: this
}));
}
});
});

@ -6,11 +6,9 @@ $testSearchPattern = '*.Test\bin\x86\Release'
Function Build()
{
$clean = $msbuild + " nzbdrone.sln /t:Clean /m"
$build = $msbuild + " nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build /m"
$clean = $msbuild + " src\nzbdrone.sln /t:Clean /m"
$build = $msbuild + " src\nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build /m"
if(Test-Path $outputFolder)
{
Remove-Item -Recurse -Force $outputFolder -ErrorAction Continue
@ -72,7 +70,7 @@ Function PackageMono()
get-childitem $outputFolderMono -File -Filter ServiceUninstall.* -Recurse | foreach ($_) {remove-item $_.fullname}
get-childitem $outputFolderMono -File -Filter ServiceInstall.* -Recurse | foreach ($_) {remove-item $_.fullname}
Write-Host Removing native windows binaries Sqlite, MedianInfo
Write-Host Removing native windows binaries Sqlite, MediaInfo
get-childitem $outputFolderMono -File -Filter sqlite3.* -Recurse | foreach ($_) {remove-item $_.fullname}
get-childitem $outputFolderMono -File -Filter MediaInfo.* -Recurse | foreach ($_) {remove-item $_.fullname}
@ -85,8 +83,8 @@ Function PackageMono()
Function AddJsonNet()
{
get-childitem $outputFolder -File -Filter Newtonsoft.Json.* -Recurse | foreach ($_) {remove-item $_.fullname}
Copy-Item .\packages\Newtonsoft.Json.5.*\lib\net35\*.dll -Destination $outputFolder
Copy-Item .\packages\Newtonsoft.Json.5.*\lib\net35\*.dll -Destination $outputFolder\NzbDrone.Update
Copy-Item .\src\packages\Newtonsoft.Json.5.*\lib\net35\*.dll -Destination $outputFolder
Copy-Item .\src\packages\Newtonsoft.Json.5.*\lib\net35\*.dll -Destination $outputFolder\NzbDrone.Update
}
Function PackageTests()
@ -103,9 +101,7 @@ Function PackageTests()
Copy-Item -Recurse ($_.FullName + "\*") $testPackageFolder -ErrorAction Ignore
}
.\.nuget\NuGet.exe install NUnit.Runners -Version 2.6.1 -Output $testPackageFolder
.\src\.nuget\NuGet.exe install NUnit.Runners -Version 2.6.1 -Output $testPackageFolder
Copy-Item $outputFolder\*.dll -Destination $testPackageFolder -Force
Copy-Item $outputFolder\*.pdb -Destination $testPackageFolder -Force
@ -141,4 +137,3 @@ Build
RunGrunt
PackageMono
PackageTests

@ -21,7 +21,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\_output\</OutputPath>
<OutputPath>..\..\_output\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
@ -29,7 +29,7 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\_output\</OutputPath>
<OutputPath>..\..\_output\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile>
</DocumentationFile>

@ -20,14 +20,14 @@ namespace Marr.Data.Converters
{
public class BooleanIntConverter : IConverter
{
public object FromDB(ColumnMap map, object dbValue)
public object FromDB(ConverterContext context)
{
if (dbValue == DBNull.Value)
if (context.DbValue == DBNull.Value)
{
return DBNull.Value;
}
int val = (int)dbValue;
int val = (int)context.DbValue;
if (val == 1)
{
@ -40,7 +40,12 @@ namespace Marr.Data.Converters
throw new ConversionException(
string.Format(
"The BooleanCharConverter could not convert the value '{0}' to a boolean.",
dbValue));
context.DbValue));
}
public object FromDB(ColumnMap map, object dbValue)
{
return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue });
}
public object ToDB(object clrValue)

@ -20,14 +20,14 @@ namespace Marr.Data.Converters
{
public class BooleanYNConverter : IConverter
{
public object FromDB(ColumnMap map, object dbValue)
public object FromDB(ConverterContext context)
{
if (dbValue == DBNull.Value)
if (context.DbValue == DBNull.Value)
{
return DBNull.Value;
}
string val = dbValue.ToString();
string val = context.DbValue.ToString();
if (val == "Y")
{
@ -40,7 +40,12 @@ namespace Marr.Data.Converters
throw new ConversionException(
string.Format(
"The BooleanYNConverter could not convert the value '{0}' to a boolean.",
dbValue));
context.DbValue));
}
public object FromDB(ColumnMap map, object dbValue)
{
return FromDB(new ConverterContext {ColumnMap = map, DbValue = dbValue});
}
public object ToDB(object clrValue)

@ -30,12 +30,17 @@ namespace Marr.Data.Converters
get { return typeof(TDb); }
}
public object FromDB(ColumnMap map, object dbValue)
public object FromDB(ConverterContext context)
{
TDb val = (TDb)dbValue;
TDb val = (TDb)context.DbValue;
return val.ToType(typeof(TClr), CultureInfo.InvariantCulture);
}
public object FromDB(ColumnMap map, object dbValue)
{
return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue });
}
public object ToDB(object clrValue)
{
TClr val = (TClr)clrValue;

@ -0,0 +1,13 @@
using System.Data;
using Marr.Data.Mapping;
namespace Marr.Data.Converters
{
public class ConverterContext
{
public ColumnMap ColumnMap { get; set; }
public object DbValue { get; set; }
public ColumnMapCollection MapCollection { get; set; }
public IDataRecord DataRecord { get; set; }
}
}

@ -20,11 +20,16 @@ namespace Marr.Data.Converters
{
public class EnumIntConverter : IConverter
{
public object FromDB(ColumnMap map, object dbValue)
public object FromDB(ConverterContext context)
{
if (dbValue == null || dbValue == DBNull.Value)
if (context.DbValue == null || context.DbValue == DBNull.Value)
return null;
return Enum.ToObject(map.FieldType, (int)dbValue);
return Enum.ToObject(context.ColumnMap.FieldType, (int)context.DbValue);
}
public object FromDB(ColumnMap map, object dbValue)
{
return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue });
}
public object ToDB(object clrValue)

@ -20,11 +20,16 @@ namespace Marr.Data.Converters
{
public class EnumStringConverter : IConverter
{
public object FromDB(ColumnMap map, object dbValue)
public object FromDB(ConverterContext context)
{
if (dbValue == null || dbValue == DBNull.Value)
if (context.DbValue == null || context.DbValue == DBNull.Value)
return null;
return Enum.Parse(map.FieldType, (string)dbValue);
return Enum.Parse(context.ColumnMap.FieldType, (string)context.DbValue);
}
public object FromDB(ColumnMap map, object dbValue)
{
return FromDB(new ConverterContext { ColumnMap = map, DbValue = dbValue });
}
public object ToDB(object clrValue)

@ -20,6 +20,9 @@ namespace Marr.Data.Converters
{
public interface IConverter
{
object FromDB(ConverterContext context);
[Obsolete("use FromDB(ConverterContext context) instead")]
object FromDB(ColumnMap map, object dbValue);
object ToDB(object clrValue);
Type DbType { get; }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save